| HTML文件標記 <html> <head> <!--> <title> <body> 文字排版標記
HTML文件標記 <html> <head> <!--> <title> <body> 文字排版標記 <br/> <nobr> <p> <pre> 原始文字樣式 <center> <blockquote> 向內縮排 <h> 標題 <strong>,<b> 粗體 <em>,<i>,<cite> 斜體 <U> 底線(xiàn) <strike> 刪除線(xiàn) <blink> 文字閃爍 <big> 大型字體 <small> 小型字體 <sup> 文字上標 <SUB> 文字下標 <basefont> 默認字體設置 <font> 更改字體設置 菜單標記 <menu> 選項菜單 <dir> 目錄菜單 <lh> 菜單格式(一) <ul> 菜單格式(二) <dl>,<dt>,<dd> 說(shuō)明式菜單 <ol>,<li> 標題菜單 直線(xiàn)與表格標記 <hr> <table> <tr> <td> <th> <caption> 表格標題 超鏈接標記 <a> 錨 圖形標記 <IMG> 插入圖形 框架標記 <FRAME> 定義框架內容 <NOFRAME> 不支持框架聲明 表單標記 <FORM> <INPUT> <TEXTAREA> <SELECT> <OPTION> SCRIPT <script> VBSCRIPT標記索引 基本運算 + 數字加法及字符串連接 - 數字減法 * 數字乘法 / 數字除法 Mod 求余數 \ 求商數 & 字符串連接 ^ 次方 = 相等 <> 不相等 >= 大于或等于 > 大于 <= 小于或等于 < 小于 Not 非 And 且 Or 或 Xor 異或 循環(huán)及決策 if ....then 若...則... if ...then...else 若...則...非 else if... 非若 select case... 群組選擇條件 end select for ... next 計數循環(huán) while...wend 條件循環(huán)(一) do while...loop 條件循環(huán)(二) do...loop while 條件循環(huán)(三) do until...loop 條件循環(huán)(四) do...loop until 條件循環(huán)(五) 數學(xué)函數 Abs 絕對值 Sgn 正負號 Hex 轉換成十六進(jìn)制 Oct 轉換成八進(jìn)制 Sqr 平方根 Int 取整數 Fix 取整數 Round 取整數 Log 以e為底的對數 Sin 正弦函數 Cos 余弦函數 Tan 正切函數 字符串處理函數 Len 字符串長(cháng)度 Mid 取部分字符串 Left 從字符串開(kāi)頭取部分字符串 Right 從字符串結尾取部分字符串 Lcase 轉換成小寫(xiě) Ucase 轉換成大寫(xiě) Trim 清除字符串開(kāi)頭及結尾的空格符 Ltrim 清除字符串開(kāi)頭空格符 Rtrim 清除字符串結尾空格符 Replace 替換字符串部分字符 Instr 判斷是否包含于另一個(gè)字符串(從起始搜尋) InstrRev 判斷是否包含于另一個(gè)字符串(從結尾搜尋) Space 任意字符數的空格符 String 任意字符數的任一字符 StrReverse 反轉字符串 Split 以某字符分割字符串 數據類(lèi)型轉換函數 Cint 轉換成整形 Cstr 轉換成字符串 Clng 轉換成常整數 Cbool 轉換成布爾函數 Cdate 轉換成日期函數 CSng 轉換成單精度 CDbl 轉換成雙精度 日期時(shí)間函數 Date 現在日期 Time 現在時(shí)間 NOw 現在日期時(shí)間 DateAdd 增加日期 DateDiff 兩日期差 DateSerial 日期設定 DateValue 日期設定 Year 現在年份 Month 現在月份 Day 現在天 Hour 現在時(shí)刻 Minute 現在分鐘 Second 現在秒鐘 Timer 午夜距現在秒數 TimeSerial 時(shí)間設定 TimeValue 時(shí)間所屬部分 WeekDay 星期名稱(chēng) MonthName 月份名稱(chēng) 其它函數 Array 產(chǎn)生數組 Asc 字符ASCII碼 Chr ASCII碼字符 Filter 過(guò)濾數組 InputBox 輸入窗口 Join 合并數組中的元素 MsgBox 信息窗口 Lbound 數組下界 Ubound 數組上界 指令 Const 設定常數 Dim 定義變量或者數組 Erase 清除數組 ReDim 重新聲明數組 Randomize 起始隨機數 Rnd 取得隨機數 ASP對象 Session對象 IsEmpty 測試Session變量是否存在 TimeOut 設定Session變量生存周期 Abandon 強制清除Session變量 Application對象 IsEmpty 測試Application變量是否存在 Lock 鎖定Application變量 Unlock 解除Lock指令的鎖定 Cookies對象 Expires 設定Cookies變量的生存周期 Connection對象 Open 打開(kāi)與數據庫的連接 Execute 打開(kāi)Recordset對象 Close 關(guān)閉Connection對象 Recordset對象 movefirst 將記錄指針移至第一條 movelast 將記錄指針移至最后一條 movenext 將記錄指針移至下一條 moveprevious 將記錄指針移至上一條 bof 測試是否為recordset的起始 eof 測試是否為recordset的結束 open 打開(kāi)Recoreset對象 close 關(guān)閉recordset對象 fields 讀取數據的子對象 fileds.count 字段個(gè)數 pagesize 每頁(yè)記錄條數 absolutepage 設定為某頁(yè) pagecount 總頁(yè)數 Absoluteposition 直接跳至某條記錄 沒(méi)什么好共享的,但太感動(dòng)了,把做樹(shù)型菜單的js函數貼出來(lái), <SCRIPT language="JavaScript"> var lastObj function expandIt(obj) { if(lastObj != null) { if(obj == lastObj) { if(obj.style.display == "none") { obj.style.display = ""; } else { obj.style.display = "none" } } else { lastObj.style.display = "none"; obj.style.display = ""; } } else { obj.style.display = ""; } lastObj = obj } </SCRIPT> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <% dim id id = request("id") dim strsql,rs strsql="select * from p_type where slanguage=1 and typelevel=1 order by typename" set rs=fgetrslist(strsql) do while not rs.eof %> <tr> <td height="25" class="LEFTLINKS"><img width="30" height="0" align="absmiddle" /><b><%if rs("isleaf")=0 then%><a href="#" onClick="javascript:expandIt(kb<%=rs("id")%>);return false"><%else%><a href="<%=request.ServerVariables("SCRIPT_NAME")%>?idtree=<%=rs("idtree")%>" ><%end if%><%=server.HTMLEncode(right((rs("typename")&""),len(rs("typename")&"")-2))%></a></b></td> </tr> <% IF clng(id)=clng(rs("id")) then %> <tr id="kb<%=rs("id")%>"> <% else %> <tr id="kb<%=rs("id")%>" style="display:none;"> <% end if %> <td> <table> <% dim rs1 strsql="select * from p_type where parentid="&rs("id")&" and slanguage=1 order by typename" set rs1=fgetrslist(strsql) do while not rs1.eof %> <tr><td height="20" class="LEFTLINKS"> <img width="40" height="0" align="absmiddle" /><a href="<%=request.ServerVariables("SCRIPT_NAME")%>?idtree=<%=rs1("idtree")%>&id=<%=rs("id")%>" ><%=server.HTMLEncode(right((rs1("typename")&""),len(rs1("typename")&"")-2))%></a></td></tr> <% rs1.movenext loop rs1.close set rs1=nothing %> </table> </td> </tr> <% rs.movenext loop rs.close set rs=nothing %> </table> 計算網(wǎng)頁(yè)文本的漢字字數,去掉了表格以外的所有標識。 Function GetLength(strChinese1) Dim strWord, ascWord, lenTotal strChinese1 = Trim(strChinese1) If strChinese1 = "" Or Vartype(strChinese1) = vbNull Then GetLength = 0 Exit Function End If lenTotal = 0 For GetLengthi=1 to Len(strChinese1) strWord = Mid(strChinese1, GetLengthi, 1) ascWord = Asc(strWord) If ascWord < 0 or ascWord > 127 then lenTotal = lenTotal + 1 Elseif ascWord = 63 And strWord <> "?" then lenTotal = lenTotal + 1 Elseif ascWord = 44 And strWord <> "," then lenTotal = lenTotal + 1 Elseif ascWord = 33 And strWord <> "!" then lenTotal = lenTotal + 1 Else lenTotal = lenTotal End If Next GetLength = lenTotal End Function 昨天有人問(wèn)MicrosoftVBscript運行時(shí)錯誤的全部列表,我給他回了vbscript幫助里面的錯誤列表,回來(lái)自己用Err.Raise做了個(gè)編歷的小程序,發(fā)現給人家發(fā)的不全,再想貼卻發(fā)現有限制,連續不能發(fā)三貼以上。。郁悶 MicrosoftVBscript運行時(shí)錯誤(完整版)共121個(gè) MicrosoftVBscript運行時(shí)錯誤(0x000A0005) 無(wú)效的過(guò)程調用或參數 MicrosoftVBscript運行時(shí)錯誤(0x000A0005) 無(wú)效的過(guò)程調用或參數 MicrosoftVBscript運行時(shí)錯誤(0x000A0006) 溢出 MicrosoftVBscript運行時(shí)錯誤(0x000A0007) 內存不夠 MicrosoftVBscript運行時(shí)錯誤(0x000A0009) 下標越界 MicrosoftVBscript運行時(shí)錯誤(0x000A000A) 該數組為定長(cháng)的或臨時(shí)被鎖定 MicrosoftVBscript運行時(shí)錯誤(0x000A000B) 被零除 MicrosoftVBscript運行時(shí)錯誤(0x000A000D) 類(lèi)型不匹配 MicrosoftVBscript運行時(shí)錯誤(0x000A000E) 字符串空間不夠 MicrosoftVBscript運行時(shí)錯誤(0x000A0011) 不能執行所需的操作 MicrosoftVBscript運行時(shí)錯誤(0x000A001C) 堆棧溢出 MicrosoftVBscript運行時(shí)錯誤(0x000A0023) 未定義過(guò)程或函數 MicrosoftVBscript運行時(shí)錯誤(0x000A0030) 加載 DLL 時(shí)出錯 MicrosoftVBscript運行時(shí)錯誤(0x000A0033) 內部錯誤 MicrosoftVBscript運行時(shí)錯誤(0x000A0034) 錯誤的文件名或號碼 MicrosoftVBscript運行時(shí)錯誤(0x000A0035) 文件未找到 MicrosoftVBscript運行時(shí)錯誤(0x000A0036) 錯誤的文件模式 MicrosoftVBscript運行時(shí)錯誤(0x000A0037) 文件已經(jīng)打開(kāi) MicrosoftVBscript運行時(shí)錯誤(0x000A0039) 設備 I/O 錯誤 MicrosoftVBscript運行時(shí)錯誤(0x000A003A) 文件已存在 MicrosoftVBscript運行時(shí)錯誤(0x000A003D) 磁盤(pán)已滿(mǎn) MicrosoftVBscript運行時(shí)錯誤(0x000A003E) 輸入超出了文件尾 MicrosoftVBscript運行時(shí)錯誤(0x000A0043) 文件過(guò)多 MicrosoftVBscript運行時(shí)錯誤(0x000A0044) 設備不可用 MicrosoftVBscript運行時(shí)錯誤(0x000A0046) 沒(méi)有權限 MicrosoftVBscript運行時(shí)錯誤(0x000A0047) 磁盤(pán)沒(méi)有準備好 MicrosoftVBscript運行時(shí)錯誤(0x000A004A) 重命名時(shí)不能帶有其他驅動(dòng)器符號 MicrosoftVBscript運行時(shí)錯誤(0x000A004B) 路徑/文件訪(fǎng)問(wèn)錯誤 MicrosoftVBscript運行時(shí)錯誤(0x000A004C) 路徑未找到 MicrosoftVBscript運行時(shí)錯誤(0x000A005B) 對象變量未設置 MicrosoftVBscript運行時(shí)錯誤(0x000A005C) For 循環(huán)未初始化 MicrosoftVBscript運行時(shí)錯誤(0x000A005E) 無(wú)效使用 Null MicrosoftVBscript運行時(shí)錯誤(0x000A0142) 不能創(chuàng )建必要的臨時(shí)文件 MicrosoftVBscript運行時(shí)錯誤(0x000A01A8) 缺少對象 MicrosoftVBscript運行時(shí)錯誤(0x000A01AD) ActiveX 部件不能創(chuàng )建對象 MicrosoftVBscript運行時(shí)錯誤(0x000A01AE) 類(lèi)不支持 Automation 操作 MicrosoftVBscript運行時(shí)錯誤(0x000A01B0) Automation 操作中文件名或類(lèi)名未找到 MicrosoftVBscript運行時(shí)錯誤(0x000A01B6) 對象不支持此屬性或方法 MicrosoftVBscript運行時(shí)錯誤(0x000A01B8) Automation 操作錯誤 MicrosoftVBscript運行時(shí)錯誤(0x000A01BD) 對象不支持此操作 MicrosoftVBscript運行時(shí)錯誤(0x000A01BE) 對象不支持已命名參數 MicrosoftVBscript運行時(shí)錯誤(0x000A01BF) 對象不支持當前區域設置選項 MicrosoftVBscript運行時(shí)錯誤(0x000A01C0) 未找到已命名參數 MicrosoftVBscript運行時(shí)錯誤(0x000A01C1) 參數是必選項 MicrosoftVBscript運行時(shí)錯誤(0x000A01C2) 錯誤的參數個(gè)數或無(wú)效的參數屬性值 MicrosoftVBscript運行時(shí)錯誤(0x000A01C3) 對象不是一個(gè)集合 MicrosoftVBscript運行時(shí)錯誤(0x000A01C5) 未找到指定的 DLL 函數 MicrosoftVBscript運行時(shí)錯誤(0x000A01C7) 代碼資源鎖定錯誤 MicrosoftVBscript運行時(shí)錯誤(0x000A01C9) 此鍵已與該集合的一個(gè)元素關(guān)聯(lián) MicrosoftVBscript運行時(shí)錯誤(0x000A01CA) 變量使用了一個(gè) VBScript 中不支持的 Automation 類(lèi)型 MicrosoftVBscript運行時(shí)錯誤(0x000A01CE) 遠程服務(wù)器不存在或不可用 MicrosoftVBscript運行時(shí)錯誤(0x000A01E1) 無(wú)效圖片 MicrosoftVBscript運行時(shí)錯誤(0x000A01F4) 變量未定義 MicrosoftVBscript運行時(shí)錯誤(0x000A01F5) 非法賦值 MicrosoftVBscript運行時(shí)錯誤(0x000A01F6) 對象不能安全用 Script 編程 MicrosoftVBscript運行時(shí)錯誤(0x000A01F7) 對象不能安全初始化 MicrosoftVBscript運行時(shí)錯誤(0x000A01F8) 對象不能安全創(chuàng )建 MicrosoftVBscript運行時(shí)錯誤(0x000A01F9) 無(wú)效的或無(wú)資格的引用 MicrosoftVBscript運行時(shí)錯誤(0x000A01FA) 類(lèi)沒(méi)有被定義 MicrosoftVBscript運行時(shí)錯誤(0x000A01FB) 出現一個(gè)意外錯誤 MicrosoftVBscript運行時(shí)錯誤(0x000A03E9) 內存不夠 MicrosoftVBscript運行時(shí)錯誤(0x000A03EA) 語(yǔ)法錯誤 MicrosoftVBscript運行時(shí)錯誤(0x000A03EB) 缺少 ‘:‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03ED) 缺少 ‘(‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03EE) 缺少 ‘)‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03EF) 缺少 ‘]‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03F2) 缺少標識符 MicrosoftVBscript運行時(shí)錯誤(0x000A03F3) 缺少 ‘=‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03F4) 缺少 ‘If‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03F5) 缺少 ‘To‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03F6) 缺少 ‘End‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03F7) 缺少 ‘Function‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03F8) 缺少 ‘Sub‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03F9) 缺少 ‘Then‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03FA) 缺少 ‘Wend‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03FB) 缺少 ‘Loop‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03FC) 缺少 ‘Next‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03FD) 缺少 ‘Case‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03FE) 缺少 ‘Select‘ MicrosoftVBscript運行時(shí)錯誤(0x000A03FF) 缺少表達式 MicrosoftVBscript運行時(shí)錯誤(0x000A0400) 缺少語(yǔ)句 MicrosoftVBscript運行時(shí)錯誤(0x000A0401) 語(yǔ)句未結束 MicrosoftVBscript運行時(shí)錯誤(0x000A0402) 缺少整型常數 MicrosoftVBscript運行時(shí)錯誤(0x000A0403) 缺少 ‘While‘ 或 ‘Until‘ MicrosoftVBscript運行時(shí)錯誤(0x000A0404) 缺少 ‘While‘ 和 ‘Until‘或語(yǔ)句未結束 MicrosoftVBscript運行時(shí)錯誤(0x000A0405) 缺少 ‘With‘ MicrosoftVBscript運行時(shí)錯誤(0x000A0406) 標識符過(guò)長(cháng) MicrosoftVBscript運行時(shí)錯誤(0x000A0407) 無(wú)效數字 MicrosoftVBscript運行時(shí)錯誤(0x000A0408) 無(wú)效字符 MicrosoftVBscript運行時(shí)錯誤(0x000A0409) 未結束的字符串常量 MicrosoftVBscript運行時(shí)錯誤(0x000A040A) 注釋未結束 MicrosoftVBscript運行時(shí)錯誤(0x000A040D) 無(wú)效使用 ‘Me‘ 關(guān)鍵字 MicrosoftVBscript運行時(shí)錯誤(0x000A040E) ‘loop‘ 語(yǔ)句缺少 ‘do‘ MicrosoftVBscript運行時(shí)錯誤(0x000A040F) 無(wú)效的 ‘exit‘ 語(yǔ)句 MicrosoftVBscript運行時(shí)錯誤(0x000A0410) 循環(huán)控制變量 ‘for‘ 無(wú)效 MicrosoftVBscript運行時(shí)錯誤(0x000A0411) 名稱(chēng)重定義 MicrosoftVBscript運行時(shí)錯誤(0x000A0412) 必須是行中的第一個(gè)語(yǔ)句 MicrosoftVBscript運行時(shí)錯誤(0x000A0413) 不能為 non-ByVal 參數賦值 MicrosoftVBscript運行時(shí)錯誤(0x000A0414) 調用子程序時(shí)不能使用括號 MicrosoftVBscript運行時(shí)錯誤(0x000A0415) 缺少文字常數 MicrosoftVBscript運行時(shí)錯誤(0x000A0416) 缺少 ‘In‘ MicrosoftVBscript運行時(shí)錯誤(0x000A0417) 缺少 ‘Class‘ MicrosoftVBscript運行時(shí)錯誤(0x000A0418) 必須在一個(gè)類(lèi)的內部定義 MicrosoftVBscript運行時(shí)錯誤(0x000A0419) 在屬性聲明中缺少 Let , Set 或 Get MicrosoftVBscript運行時(shí)錯誤(0x000A041A) 缺少 ‘Property‘ MicrosoftVBscript運行時(shí)錯誤(0x000A041B) 在所有屬性的規范中,變量的數目必須一致 MicrosoftVBscript運行時(shí)錯誤(0x000A041C) 在一個(gè)類(lèi)中不允許有多個(gè)缺省的屬性/方法 MicrosoftVBscript運行時(shí)錯誤(0x000A041D) 類(lèi)的初始化或終止程序沒(méi)有變量 MicrosoftVBscript運行時(shí)錯誤(0x000A041E) 屬性的 set 或 let 必須至少有一個(gè)變量 MicrosoftVBscript運行時(shí)錯誤(0x000A041F) 錯誤的 ‘Next‘ MicrosoftVBscript運行時(shí)錯誤(0x000A0420) ‘Default‘ 只能在 ‘Property‘ , ‘Function‘ 或 ‘Sub‘ 中指定 MicrosoftVBscript運行時(shí)錯誤(0x000A0421) 指定 ‘Default‘ 時(shí)必須同時(shí)指定 ‘Public‘ MicrosoftVBscript運行時(shí)錯誤(0x000A0422) 只能在 Property Get 中指定 ‘Default‘ MicrosoftVBscript運行時(shí)錯誤(0x000A1000) Microsoft VBScript 編譯器錯誤 MicrosoftVBscript運行時(shí)錯誤(0x000A1001) Microsoft VBScript 運行時(shí)錯誤 MicrosoftVBscript運行時(shí)錯誤(0x000A1398) 缺少正則表達式對象 MicrosoftVBscript運行時(shí)錯誤(0x000A1399) 正則表達式語(yǔ)法錯誤 MicrosoftVBscript運行時(shí)錯誤(0x000A139A) 錯誤的數量詞 MicrosoftVBscript運行時(shí)錯誤(0x000A139B) 正則表達式中缺少 ‘]‘ MicrosoftVBscript運行時(shí)錯誤(0x000A139C) 正則表達式中缺少 ‘)‘ MicrosoftVBscript運行時(shí)錯誤(0x000A139D) 字符集越界 10進(jìn)制表示,希望actor2222 (優(yōu)悠) 能看到 MicrosoftVBscript運行時(shí)錯誤列表(10進(jìn)制表示) error # 5 無(wú)效的過(guò)程調用或參數 error # 5 無(wú)效的過(guò)程調用或參數 error # 6 溢出 error # 7 內存不夠 error # 9 下標越界 error # 10 該數組為定長(cháng)的或臨時(shí)被鎖定 error # 11 被零除 error # 13 類(lèi)型不匹配 error # 14 字符串空間不夠 error # 17 不能執行所需的操作 error # 28 堆棧溢出 error # 35 未定義過(guò)程或函數 error # 48 加載 DLL 時(shí)出錯 error # 51 內部錯誤 error # 52 錯誤的文件名或號碼 error # 53 文件未找到 error # 54 錯誤的文件模式 error # 55 文件已經(jīng)打開(kāi) error # 57 設備 I/O 錯誤 error # 58 文件已存在 error # 61 磁盤(pán)已滿(mǎn) error # 62 輸入超出了文件尾 error # 67 文件過(guò)多 error # 68 設備不可用 error # 70 沒(méi)有權限 error # 71 磁盤(pán)沒(méi)有準備好 error # 74 重命名時(shí)不能帶有其他驅動(dòng)器符號 error # 75 路徑/文件訪(fǎng)問(wèn)錯誤 error # 76 路徑未找到 error # 91 對象變量未設置 error # 92 For 循環(huán)未初始化 error # 94 無(wú)效使用 Null error # 322 不能創(chuàng )建必要的臨時(shí)文件 error # 424 缺少對象 error # 429 ActiveX 部件不能創(chuàng )建對象 error # 430 類(lèi)不支持 Automation 操作 error # 432 Automation 操作中文件名或類(lèi)名未找到 error # 438 對象不支持此屬性或方法 error # 440 Automation 操作錯誤 error # 445 對象不支持此操作 error # 446 對象不支持已命名參數 error # 447 對象不支持當前區域設置選項 error # 448 未找到已命名參數 error # 449 參數是必選項 error # 450 錯誤的參數個(gè)數或無(wú)效的參數屬性值 error # 451 對象不是一個(gè)集合 error # 453 未找到指定的 DLL 函數 error # 455 代碼資源鎖定錯誤 error # 457 此鍵已與該集合的一個(gè)元素關(guān)聯(lián) error # 458 變量使用了一個(gè) VBScript 中不支持的 Automation 類(lèi)型 error # 462 遠程服務(wù)器不存在或不可用 error # 481 無(wú)效圖片 error # 500 變量未定義 error # 501 非法賦值 error # 502 對象不能安全用 Script 編程 error # 503 對象不能安全初始化 error # 504 對象不能安全創(chuàng )建 error # 505 無(wú)效的或無(wú)資格的引用 error # 506 類(lèi)沒(méi)有被定義 error # 507 出現一個(gè)意外錯誤 error # 1001 內存不夠 error # 1002 語(yǔ)法錯誤 error # 1003 缺少 ‘:‘ error # 1005 缺少 ‘(‘ error # 1006 缺少 ‘)‘ error # 1007 缺少 ‘]‘ error # 1010 缺少標識符 error # 1011 缺少 ‘=‘ error # 1012 缺少 ‘If‘ error # 1013 缺少 ‘To‘ error # 1014 缺少 ‘End‘ error # 1015 缺少 ‘Function‘ error # 1016 缺少 ‘Sub‘ error # 1017 缺少 ‘Then‘ error # 1018 缺少 ‘Wend‘ error # 1019 缺少 ‘Loop‘ error # 1020 缺少 ‘Next‘ error # 1021 缺少 ‘Case‘ error # 1022 缺少 ‘Select‘ error # 1023 缺少表達式 error # 1024 缺少語(yǔ)句 error # 1025 語(yǔ)句未結束 error # 1026 缺少整型常數 error # 1027 缺少 ‘While‘ 或 ‘Until‘ error # 1028 缺少 ‘While‘ 和 ‘Until‘或語(yǔ)句未結束 error # 1029 缺少 ‘With‘ error # 1030 標識符過(guò)長(cháng) error # 1031 無(wú)效數字 error # 1032 無(wú)效字符 error # 1033 未結束的字符串常量 error # 1034 注釋未結束 error # 1037 無(wú)效使用 ‘Me‘ 關(guān)鍵字 error # 1038 ‘loop‘ 語(yǔ)句缺少 ‘do‘ error # 1039 無(wú)效的 ‘exit‘ 語(yǔ)句 error # 1040 循環(huán)控制變量 ‘for‘ 無(wú)效 error # 1041 名稱(chēng)重定義 error # 1042 必須是行中的第一個(gè)語(yǔ)句 error # 1043 不能為 non-ByVal 參數賦值 error # 1044 調用子程序時(shí)不能使用括號 error # 1045 缺少文字常數 error # 1046 缺少 ‘In‘ error # 1047 缺少 ‘Class‘ error # 1048 必須在一個(gè)類(lèi)的內部定義 error # 1049 在屬性聲明中缺少 Let , Set 或 Get error # 1050 缺少 ‘Property‘ error # 1051 在所有屬性的規范中,變量的數目必須一致 error # 1052 在一個(gè)類(lèi)中不允許有多個(gè)缺省的屬性/方法 error # 1053 類(lèi)的初始化或終止程序沒(méi)有變量 error # 1054 屬性的 set 或 let 必須至少有一個(gè)變量 error # 1055 錯誤的 ‘Next‘ error # 1056 ‘Default‘ 只能在 ‘Property‘ , ‘Function‘ 或 ‘Sub‘ 中指定 error # 1057 指定 ‘Default‘ 時(shí)必須同時(shí)指定 ‘Public‘ error # 1058 只能在 Property Get 中指定 ‘Default‘ error # 4096 Microsoft VBScript 編譯器錯誤 error # 4097 Microsoft VBScript 運行時(shí)錯誤 error # 5016 缺少正則表達式對象 error # 5017 正則表達式語(yǔ)法錯誤 error # 5018 錯誤的數量詞 error # 5019 正則表達式中缺少 ‘]‘ error # 5020 正則表達式中缺少 ‘)‘ error # 5021 字符集越界 利用ASP獲得圖象的實(shí)際尺寸的示例 <!--#include virtual="/learn/test/lib_graphicdetect.asp"--> <html><head> <TITLE>dbtable.asp</TITLE> </head> <body bgcolor="#FFFFFF"> <% graphic="images/learnaspiconmain.gif" HW = ReadImg(graphic) Response.Write graphic & " Dimensions: " & HW(0) & "x" & HW(1) & "<br/>" response.write "<img src=""/" & graphic & """" response.write height=""" & HW(0) & """ response.write width=""" & HW(0) & "">" %> </body></html> The library that is included is: <% Dim HW Function AscAt(s, n) AscAt = Asc(Mid(s, n, 1)) End Function Function HexAt(s, n) HexAt = Hex(AscAt(s, n)) End Function Function isJPG(fichero) If inStr(uCase(fichero), ".JPG") <> 0 Then isJPG = true Else isJPG = false End If End Function Function isPNG(fichero) If inStr(uCase(fichero), ".PNG") <> 0 Then isPNG = true Else isPNG = false End If End Function Function isGIF(fichero) If inStr(uCase(fichero), ".GIF") <> 0 Then isGIF = true Else isGIF = false End If End Function Function isBMP(fichero) If inStr(uCase(fichero), ".BMP") <> 0 Then isBMP = true Else isBMP = false End If End Function Function isWMF(fichero) If inStr(uCase(fichero), ".WMF") <> 0 Then isWMF = true Else isWMF = false End If End Function Function isWebImg(f) If isGIF(f) Or isJPG(f) Or isPNG(f) Or isBMP(f) Or isWMF(f) Then isWebImg = true Else isWebImg = true End If End Function Function ReadImg(fichero) If isGIF(fichero) Then ReadImg = ReadGIF(fichero) Else If isJPG(fichero) Then ReadImg = ReadJPG(fichero) Else If isPNG(fichero) Then ReadImg = ReadPNG(fichero) Else If isBMP(fichero) Then ReadImg = ReadPNG(fichero) Else If isWMF(fichero) Then ReadImg = ReadWMF(fichero) Else ReadImg = Array(0,0) End If End If End If End If End If End Function Function ReadJPG(fichero) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & fichero), 1) s = Right(ts.Read(167), 4) HW(0) = HexToDec(HexAt(s,3) & HexAt(s,4)) HW(1) = HexToDec(HexAt(s,1) & HexAt(s,2)) ts.Close ReadJPG = HW End Function Function ReadPNG(fichero) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & fichero), 1) s = Right(ts.Read(24), 8) HW(0) = HexToDec(HexAt(s,3) & HexAt(s,4)) HW(1) = HexToDec(HexAt(s,7) & HexAt(s,8)) ts.Close ReadPNG = HW End Function Function ReadGIF(fichero) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & fichero), 1) s = Right(ts.Read(10), 4) HW(0) = HexToDec(HexAt(s,2) & HexAt(s,1)) HW(1) = HexToDec(HexAt(s,4) & HexAt(s,3)) ts.Close ReadGIF = HW End Function Function ReadWMF(fichero) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & fichero), 1) s = Right(ts.Read(14), 4) HW(0) = HexToDec(HexAt(s,2) & HexAt(s,1)) HW(1) = HexToDec(HexAt(s,4) & HexAt(s,3)) ts.Close ReadWMF = HW End Function Function ReadBMP(fichero) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & fichero), 1) s = Right(ts.Read(24), 8) HW(0) = HexToDec(HexAt(s,4) & HexAt(s,3)) HW(1) = HexToDec(HexAt(s,8) & HexAt(s,7)) ts.Close ReadBMP = HW End Function Function isDigit(c) If inStr("0123456789", c) <> 0 Then isDigit = true Else isDigit = false End If End Function Function isHex(c) If inStr("0123456789ABCDEFabcdef", c) <> 0 Then isHex = true Else ishex = false End If End Function Function HexToDec(cadhex) Dim n, i, ch, decimal decimal = 0 n = Len(cadhex) For i=1 To n ch = Mid(cadhex, i, 1) If isHex(ch) Then decimal = decimal * 16 If isDigit(c) Then decimal = decimal + ch Else decimal = decimal + Asc(uCase(ch)) - Asc("A") End If Else HexToDec = -1 End If Next HexToDec = decimal End Function %> 常用的javascript function file://========================================= // 輸入數據檢驗 // 檢驗空值 function funCheckEmpty(m_Text) { var strTmp=m_Text if (strTmp == null || strTmp == "") { return false } return true } file://檢驗內容的長(cháng)度 function funTextLenCheck(m_Text) { var strText=m_Text for(i=0;i<=strText.length-1;i++){ if (strText.charCodeAt(i)>=256){ return strText.length * 2 } } return strText.length } file://檢驗長(cháng)度 function funCheckLen(m_Len,m_Text) { if (funTextLenCheck(m_Text)> m_Len) { return false } return true } file://檢驗是否為數字 function funCheckNumber(m_Text) { var strTmp=m_Text if (isNaN(strTmp)) { return false } return true } file://檢驗日期是否合法 function funcheckDate(m_Year,m_Month,m_Day){ file://根據月先取得最大日期 var maxDay if (m_Month==2) { maxDay=28 if (m_Year % 4 ==0) { maxDay=29 } } else { if (m_Month<=7){ if (m_Month % 2 ==0){ maxDay=30 }else{ maxDay=31 } }else{ if (m_Month % 2 ==0){ maxDay=31 }else{ maxDay=30 } } } if (m_Day>maxDay){ return false } return true } file://讀取Cookies信息 function GetCookie(strCookName){ var arvCookies=document.cookie.split("; ") for(var i=0;i< arvCookies.length; i++) { var arvOneCookie=arvCookies[i].split("=") if (strCookName==arvOneCookie[0]){ return unescape(arvOneCookie[1]) } } return "" } file://替換字符串中的非法字符 function Replace_Text(text){ var strTmp=text strTmp=strTmp.replace("@", "@") strTmp=strTmp.replace("?", "?") strTmp=strTmp.replace("&", "&") strTmp=strTmp.replace("‘", "‘") strTmp=strTmp.replace("<", "〈") strTmp=strTmp.replace(">", "〉") return strTmp } function Check_PassWord(text){ var strTmp=text if (strTmp.indexOf("‘")>-1){ return "‘" } if (strTmp.indexOf("?")>-1){ return "?" } if (strTmp.indexOf("&")>-1){ return "&" } if (strTmp.indexOf("<")>-1){ return "<" } if (strTmp.indexOf(">")>-1){ return ">" } return "" } function Check_Url(text){ var strTmp=text if (strTmp.indexOf("‘")>-1){ return false } return true } file://焦點(diǎn)控制 function document.onkeydown(){ var e = event.srcElement; if (event.keyCode == 13 && e.tagName == "INPUT" && e.type == "text"){ event.keyCode = 9; } } <% response.write " 1.oncontextmenu="window.event.returnvalue=false"將徹底屏蔽鼠標右鍵 <tableborderoncontextmenu=return(false)><td>no</table>可用于table 2.<bodyonselectstart="returnfalse">取消選取、防止復制 3.onpaste="returnfalse"不準粘貼 4.oncopy="returnfalse;"oncut="returnfalse;"防止復制 5.<linkrel="shortcuticon"href="favicon.ico">ie地址欄前換成自己的圖標 6.<linkrel="bookmark"href="favicon.ico">可以在收藏夾中顯示出你的圖標 7.<inputstyle="ime-mode:disabled">關(guān)閉輸入法 8.永遠都會(huì )帶著(zhù)框架 <scriptlanguage="javascript"><!-- if(window==top)top.location.href="frames.htm";//frames.htm為框架網(wǎng)頁(yè) file://--></script> 9.防止被人frame <scriptlanguage=javascript><!-- if(top.location!=self.location)top.location=self.location; file://--></script> 10.<noscript><iframesrc=*.html></iframe></noscript>網(wǎng)頁(yè)將不能被另存為 11.<inputtype=buttonvalue=查看網(wǎng)頁(yè)源代碼 onclick="window.location=view-source:+<img src="pic/url.gif" align=absmiddle border=0> http://www.csdn.net/";;;;> 12.怎樣通過(guò)asp的手段來(lái)檢查來(lái)訪(fǎng)者是否用了代理 <%ifrequest.servervariables("http_x_forwarded_for")<>""then response.write"<fontcolor=#ff0000>您通過(guò)了代理服務(wù)器,"&_ "真實(shí)的ip為"&request.servervariables("http_x_forwarded_for") endif "%> <% response.write" 13.取得控件的絕對位置 file://javascript <scriptlanguage="javascript"> functiongetie(e){ vart=e.offsettop; varl=e.offsetleft; while(e=e.offsetparent){ t+=e.offsettop; l+=e.offsetleft; } alert("top="+t+"\nleft="+l); } </script> file://vbscript <scriptlanguage="vbscript"><!-- functiongetie() dimt,l,a,b seta=document.all.img1 t=document.all.img1.offsettop l=document.all.img1.offsetleft whilea.tagname<>"body" seta=a.offsetparent t=t+a.offsettop l=l+a.offsetleft wend msgbox"top="&t&chr(13)&"left="&l,64,"得到控件的位置" endfunction --></script> 14.光標是停在文本框文字的最后 <scriptlanguage="javascript"> functioncc() { vare=event.srcelement; varr=e.createtextrange(); r.movestart(character,e.value.length); r.collapse(true); r.select(); } </script> <inputtype=textname=text1value="123"onfocus="cc()"> 15.判斷上一頁(yè)的來(lái)源 asp: request.servervariables("http_referer") java script: document.referrer 16.最小化、最大化、關(guān)閉窗口 <objectid=hh1classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> <paramname="command"value="minimize"></object> <objectid=hh2classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> <paramname="command"value="maximize"></object> <objectid=hh3classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> <paramname="command"value="close"></object> <inputtype=buttonvalue=最小化onclick=hh1.click()> <inputtype=buttonvalue=最大化onclick=hh2.click()> <inputtype=buttonvalue=關(guān)閉onclick=hh3.click()> 本例適用于ie 17. <% 定義數據庫連接的一些常量 constadopenforwardonly=0游標只向前瀏覽記錄,不支持分頁(yè)、recordset、bookmark constadopenkeyset=1鍵集游標,其他用戶(hù)對記錄說(shuō)做的修改將反映到記錄集中,但其他用戶(hù)增加或刪除記錄不會(huì )反映到記錄集中。支持分頁(yè)、recordset、bookmark constadopendynamic=2動(dòng)態(tài)游標功能最強,但耗資源也最多。用戶(hù)對記錄說(shuō)做的修改,增加或刪除記錄都將反映到記錄集中。支持全功能瀏覽(access不支持)。 constadopenstatic=3靜態(tài)游標,只是數據的一個(gè)快照,用戶(hù)對記錄說(shuō)做的修改,增加或刪除記錄都不會(huì )反映到記錄集中。支持向前或向后移動(dòng) constadlockreadonly=1鎖定類(lèi)型,默認的,只讀,不能作任何修改 constadlockpessimistic=2當編輯時(shí)立即鎖定記錄,最安全的方式 constadlockoptimistic=3只有在調用update方法時(shí)才鎖定記錄集,而在此前的其他操作仍可對當前記錄進(jìn)行更改、插入和刪除等 constadlockbatchoptimistic=4當編輯時(shí)記錄不會(huì )被鎖定,而更改、插入和刪除是在批處理方式下完成的 constadcmdtext=&h0001 constadcmdtable=&h0002 " %> 18.網(wǎng)頁(yè)不會(huì )被緩存 htm網(wǎng)頁(yè) <metahttp-equiv="pragma"content="no-cache"> <metahttp-equiv="cache-control"content="no-cache,must-revalidate"> <metahttp-equiv="expires"content="wed,26feb199708:21:57gmt"> 或者<metahttp-equiv="expires"content="0"> asp網(wǎng)頁(yè) response.expires=-1 response.expiresabsolute=now()-1 response.cachecontrol="no-cache" php網(wǎng)頁(yè) header("expires:mon,26jul199705:00:00gmt"); header("cache-control:no-cache,must-revalidate"); header("pragma:no-cache"); 19.檢查一段字符串是否全由數字組成 <scriptlanguage="javascript"><!-- functionchecknum(str){returnstr.match(/\d/)==null} alert(checknum("1232142141")) alert(checknum("123214214a1")) file://--></script> 20.獲得一個(gè)窗口的大小 document.body.clientwidth,document.body.clientheight 21.怎么判斷是否是字符 if(/[^\x00-\xff]/g.test(s))alert("含有漢字"); elsealert("全是字符"); 22.textarea自適應文字行數的多少 <textarearows=1 name=s1 cols=27 onpropertychange="this.style.posheight=this.scrollheight"> </textarea> 23.日期減去天數等于第二個(gè)日期 <scriptlanguage=javascript> functioncc(dd,dadd) { file://可以加上錯誤處理 vara=newdate(dd) a=a.valueof() a=a-dadd*24*60*60*1000 a=newdate(a) alert(a.getfullyear()+"年"+(a.getmonth()+1)+"月"+a.getdate()+"日") } cc("12/23/2002",2) </script> 24.選擇了哪一個(gè)radio <html><scriptlanguage="vbscript"> functioncheckme() foreachobinradio1 ifob.checkedthenwindow.alertob.value next endfunction </script><body> <input name="radio1" type="radio" value="style" checked>style <input name="radio1" type="radio" value="barcode">barcode <input type="button" value="check"onclick="checkme()"> </body></html> 25.獲得本頁(yè)url的request.servervariables("")集合 response.write"<tableborder=1><!--tableheader--><tr><td><b>variables</b></td><td><b>value</b></td></tr>" foreachobinrequest.servervariables response.write"<tr><td>"&ob&"</td><td>"&request.servervariables(ob)&"</td></tr>" next response.write"</table>" 26. 本機ip<%=request.servervariables("remote_addr")%> 服務(wù)器名<%=request.servervariables("server_name")%> 服務(wù)器ip<%=request.servervariables("local_addr")%> 服務(wù)器端口<%=request.servervariables("server_port")%> 服務(wù)器時(shí)間<%=now%> iis版本<%=request.servervariables"server_software")%> 腳本超時(shí)時(shí)間<%=server.scripttimeout%> 本文件路徑<%=server.mappath(request.servervariables("script_name"))%> 服務(wù)器cpu數量<%=request.servervariables("number_of_processors")%> 服務(wù)器解譯引擎<%=scriptengine&"/" & scriptenginemajorversion &"." & scriptengineminorversion & "." & scriptenginebuildversion%> 服務(wù)器操作系統<%=request.servervariables("os")%> 27.enter鍵可以讓光標移到下一個(gè)輸入框 <input onkeydown="if(event.keycode==13)event.keycode=9"> 28.檢測某個(gè)網(wǎng)站的鏈接速度: 把如下代碼加入<body>區域中: <scriptlanguage=javascript> tim=1 setinterval("tim++",100) b=1 varautourl=newarray() autourl[1]="< src="pic/url.gif" align=absmiddle border=0> ")}/">http://";;;;;+autourl+")>")} run()</script> 29.各種樣式的光標 auto:標準光標 default:標準箭頭 hand:手形光標 wait:等待光標 text:i形光標 vertical-text:水平i形光標 no-drop:不可拖動(dòng)光標 not-allowed:無(wú)效光標 help:?幫助光標 all-scroll:三角方向標 move:移動(dòng)標 crosshair:十字標 e-resize n-resize nw-resize w-resize s-resize se-resize sw-resize 1.本地無(wú)緩存,每次自動(dòng)刷新 response.expires=0 response.addheader"pragma","no-cache" response.addheader"cache-control","private" 2.修改contenttype并下載gif等格式 <% functiondl(f,n) onerrorresumenext sets=createobject("adodb.stream") s.mode=3 s.type=1 s.open s.loadfromfile(server.mappath(f)) iferr.number>0then response.writeerr.number&":"&err.description else response.contenttype="application/x-gzip" response.addheader"content-disposition:","attachment;filename="&n response.binarywrite(s.read(s.size)) endif endfunction calldl("012922501.gif","t1.gif") %> 19.檢查一段字符串是否全由數字組成 <scriptlanguage="javascript"><!-- functionchecknum(str){return!/\d/.test(str)} alert(checknum("1232142141")) alert(checknum("123214214a1")) file://--></script> 20.獲得一個(gè)窗口的大小 document.body.clientwidth,document.body.clientheight document.body.offsetwidth,document.body.offsetheight 有時(shí)還需要知道window.screentop,window.screenleft 21.怎么判斷是否含有漢字 if(escape(str).indexof("%u")!=-1)alert("含有漢字"); elsealert("全是字符"); 22.textarea自適應文字行數的多少 ie5.5+可以用overflow-y:visible <textarearows=1name=s1cols=27style="overflow-y:visible"> </textarea> 23.日期減去天數等于第二個(gè)日期 <scriptlanguage=javascript> functioncc(dd,dadd) { file://可以加上錯誤處理 vard=newdate(dd.replace("-","/")) d.setdate(d.getdate()+dadd) alert(d.getfullyear()+"年"+(d.getmonth()+1)+"月"+d.getdate()+"日") } cc("2002-2-28",2) </script>
|