全国各大医院排名 专科:ASP技巧集锦4

来源:百度文库 编辑:偶看新闻 时间:2024/05/01 11:10:37

HTML文件标记



<br><body></p> <p>文字排版标记<br></p> <p>HTML文件标记<br><html><br><head><br><!--><br><title><br><body></p> <p>文字排版标记<br><br/><br><nobr><br><p><br><pre> 原始文字样式<br><center><br><blockquote> 向内缩排<br><h> 标题<br><strong>,<b> 粗体<br><em>,<i>,<cite> 斜体<br><U> 底线<br><strike> 删除线<br><blink> 文字闪烁<br><big> 大型字体<br><small> 小型字体<br><sup> 文字上标<br><SUB> 文字下标<br><basefont> 默认字体设置<br><font> 更改字体设置</p> <p>菜单标记<br><menu> 选项菜单<br><dir> 目录菜单<br><lh> 菜单格式(一)<br><ul> 菜单格式(二)<br><dl>,<dt>,<dd> 说明式菜单<br><ol>,<li> 标题菜单</p> <p>直线与表格标记<br><hr><br><table><br><tr><br><td><br><th><br><caption> 表格标题</p> <p>超链接标记<br><a> 锚</p> <p>图形标记<br><IMG> 插入图形</p> <p>框架标记<br><FRAME> 定义框架内容<br><NOFRAME> 不支持框架声明</p> <p>表单标记<br><FORM><br><INPUT><br><TEXTAREA><br><SELECT><br><OPTION></p> <p>SCRIPT<br><script></p> <p>VBSCRIPT标记索引</p> <p>基本运算<br>+ 数字加法及字符串连接<br>- 数字减法<br>* 数字乘法<br>/ 数字除法<br>Mod 求余数<br>\ 求商数<br>& 字符串连接<br>^ 次方<br>= 相等<br><> 不相等<br>>= 大于或等于<br>> 大于<br><= 小于或等于<br>< 小于<br>Not 非<br>And 且<br>Or 或<br>Xor 异或</p> <p>循环及决策<br>if ....then 若...则...<br>if ...then...else 若...则...非<br>else if... 非若<br>select case... 群组选择条件<br>end select<br>for ... next 计数循环<br>while...wend 条件循环(一)<br>do while...loop 条件循环(二)<br>do...loop while 条件循环(三)<br>do until...loop 条件循环(四)<br>do...loop until 条件循环(五)</p> <p>数学函数<br>Abs 绝对值<br>Sgn 正负号<br>Hex 转换成十六进制<br>Oct 转换成八进制<br>Sqr 平方根<br>Int 取整数<br>Fix 取整数<br>Round 取整数<br>Log 以e为底的对数<br>Sin 正弦函数<br>Cos 余弦函数<br>Tan 正切函数</p> <p>字符串处理函数<br>Len 字符串长度<br>Mid 取部分字符串<br>Left 从字符串开头取部分字符串<br>Right 从字符串结尾取部分字符串<br>Lcase 转换成小写<br>Ucase 转换成大写<br>Trim 清除字符串开头及结尾的空格符<br>Ltrim 清除字符串开头空格符<br>Rtrim 清除字符串结尾空格符<br>Replace 替换字符串部分字符<br>Instr 判断是否包含于另一个字符串(从起始搜寻)<br>InstrRev 判断是否包含于另一个字符串(从结尾搜寻)<br>Space 任意字符数的空格符<br>String 任意字符数的任一字符<br>StrReverse 反转字符串<br>Split 以某字符分割字符串</p> <p>数据类型转换函数<br>Cint 转换成整形<br>Cstr 转换成字符串 <br>Clng 转换成常整数<br>Cbool 转换成布尔函数<br>Cdate 转换成日期函数<br>CSng 转换成单精度<br>CDbl 转换成双精度</p> <p>日期时间函数<br>Date 现在日期<br>Time 现在时间<br>NOw 现在日期时间<br>DateAdd 增加日期<br>DateDiff 两日期差<br>DateSerial 日期设定<br>DateValue 日期设定<br>Year 现在年份<br>Month 现在月份<br>Day 现在天<br>Hour 现在时刻<br>Minute 现在分钟<br>Second 现在秒钟<br>Timer 午夜距现在秒数<br>TimeSerial 时间设定<br>TimeValue 时间所属部分<br>WeekDay 星期名称<br>MonthName 月份名称</p> <p>其它函数<br>Array 产生数组<br>Asc 字符ASCII码<br>Chr ASCII码字符<br>Filter 过滤数组<br>InputBox 输入窗口<br>Join 合并数组中的元素<br>MsgBox 信息窗口<br>Lbound 数组下界<br>Ubound 数组上界</p> <p>指令 <br>Const 设定常数 <br>Dim 定义变量或者数组<br>Erase 清除数组<br>ReDim 重新声明数组<br>Randomize 起始随机数<br>Rnd 取得随机数</p> <p>ASP对象</p> <p>Session对象<br>IsEmpty 测试Session变量是否存在<br>TimeOut 设定Session变量生存周期<br>Abandon 强制清除Session变量</p> <p>Application对象<br>IsEmpty 测试Application变量是否存在<br>Lock 锁定Application变量<br>Unlock 解除Lock指令的锁定</p> <p>Cookies对象<br>Expires 设定Cookies变量的生存周期</p> <p>Connection对象<br>Open 打开与数据库的连接<br>Execute 打开Recordset对象<br>Close 关闭Connection对象</p> <p>Recordset对象<br>movefirst 将记录指针移至第一条<br>movelast 将记录指针移至最后一条<br>movenext 将记录指针移至下一条<br>moveprevious 将记录指针移至上一条<br>bof 测试是否为recordset的起始<br>eof 测试是否为recordset的结束<br>open 打开Recoreset对象<br>close 关闭recordset对象<br>fields 读取数据的子对象<br>fileds.count 字段个数<br>pagesize 每页记录条数<br>absolutepage 设定为某页<br>pagecount 总页数<br>Absoluteposition 直接跳至某条记录</p> <p><br> </p> <p>没什么好共享的,但太感动了,把做树型菜单的js函数贴出来,<br><SCRIPT language="JavaScript"><br>var lastObj</p> <p>function expandIt(obj)<br>{<br>if(lastObj != null)<br>{<br>if(obj == lastObj)<br>{<br>if(obj.style.display == "none")<br>{<br>obj.style.display = "";<br>}<br>else<br>{<br>obj.style.display = "none"<br>}<br>}<br>else<br>{<br>lastObj.style.display = "none";<br>obj.style.display = "";<br>}<br>}<br>else<br>{<br>obj.style.display = "";<br>}</p> <p>lastObj = obj<br>}<br></SCRIPT></p> <p><table width="100%" border="0" cellspacing="0" cellpadding="0"><br><%<br>dim id<br>id = request("id")<br>dim strsql,rs</p> <p>strsql="select * from p_type where slanguage=1 and typelevel=1 order by typename"<br>set rs=fgetrslist(strsql)<br>do while not rs.eof</p> <p>%><br><tr><br><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><br></tr><br><%<br>IF clng(id)=clng(rs("id")) then</p> <p>%><br><tr id="kb<%=rs("id")%>"><br><%<br>else</p> <p>%></p> <p><br><tr id="kb<%=rs("id")%>" style="display:none;"><br><%<br>end if<br>%><br><td><br><table><br><%<br>dim rs1<br>strsql="select * from p_type where parentid="&rs("id")&" and slanguage=1 order by typename"<br>set rs1=fgetrslist(strsql)<br>do while not rs1.eof<br>%><br><tr><td height="20" class="LEFTLINKS"><br><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><br><%<br>rs1.movenext<br>loop<br>rs1.close<br>set rs1=nothing<br>%><br></table><br></td><br></tr><br><%<br>rs.movenext</p> <p>loop<br>rs.close<br>set rs=nothing<br>%><br></table></p> <p> </p> <p>计算网页文本的汉字字数,去掉了表格以外的所有标识。<br>Function GetLength(strChinese1)<br>Dim strWord, ascWord, lenTotal<br>strChinese1 = Trim(strChinese1)</p> <p>If strChinese1 = "" Or Vartype(strChinese1) = vbNull Then<br>GetLength = 0<br>Exit Function<br>End If</p> <p>lenTotal = 0 <br>For GetLengthi=1 to Len(strChinese1)<br>strWord = Mid(strChinese1, GetLengthi, 1)<br>ascWord = Asc(strWord)<br>If ascWord < 0 or ascWord > 127 then<br>lenTotal = lenTotal + 1<br>Elseif ascWord = 63 And strWord <> "?" then<br>lenTotal = lenTotal + 1<br>Elseif ascWord = 44 And strWord <> "," then<br>lenTotal = lenTotal + 1<br>Elseif ascWord = 33 And strWord <> "!" then<br>lenTotal = lenTotal + 1<br>Else<br>lenTotal = lenTotal<br>End If<br>Next</p> <p>GetLength = lenTotal<br>End Function</p> <p><br>昨天有人问MicrosoftVBscript运行时错误的全部列表,我给他回了vbscript帮助里面的错误列表,回来自己用Err.Raise做了个编历的小程序,发现给人家发的不全,再想贴却发现有限制,连续不能发三贴以上。。郁闷</p> <p>MicrosoftVBscript运行时错误(完整版)共121个</p> <p>MicrosoftVBscript运行时错误(0x000A0005) 无效的过程调用或参数<br>MicrosoftVBscript运行时错误(0x000A0005) 无效的过程调用或参数<br>MicrosoftVBscript运行时错误(0x000A0006) 溢出<br>MicrosoftVBscript运行时错误(0x000A0007) 内存不够<br>MicrosoftVBscript运行时错误(0x000A0009) 下标越界<br>MicrosoftVBscript运行时错误(0x000A000A) 该数组为定长的或临时被锁定<br>MicrosoftVBscript运行时错误(0x000A000B) 被零除<br>MicrosoftVBscript运行时错误(0x000A000D) 类型不匹配<br>MicrosoftVBscript运行时错误(0x000A000E) 字符串空间不够<br>MicrosoftVBscript运行时错误(0x000A0011) 不能执行所需的操作<br>MicrosoftVBscript运行时错误(0x000A001C) 堆栈溢出<br>MicrosoftVBscript运行时错误(0x000A0023) 未定义过程或函数<br>MicrosoftVBscript运行时错误(0x000A0030) 加载 DLL 时出错<br>MicrosoftVBscript运行时错误(0x000A0033) 内部错误<br>MicrosoftVBscript运行时错误(0x000A0034) 错误的文件名或号码<br>MicrosoftVBscript运行时错误(0x000A0035) 文件未找到<br>MicrosoftVBscript运行时错误(0x000A0036) 错误的文件模式<br>MicrosoftVBscript运行时错误(0x000A0037) 文件已经打开<br>MicrosoftVBscript运行时错误(0x000A0039) 设备 I/O 错误<br>MicrosoftVBscript运行时错误(0x000A003A) 文件已存在<br>MicrosoftVBscript运行时错误(0x000A003D) 磁盘已满<br>MicrosoftVBscript运行时错误(0x000A003E) 输入超出了文件尾<br>MicrosoftVBscript运行时错误(0x000A0043) 文件过多<br>MicrosoftVBscript运行时错误(0x000A0044) 设备不可用<br>MicrosoftVBscript运行时错误(0x000A0046) 没有权限<br>MicrosoftVBscript运行时错误(0x000A0047) 磁盘没有准备好<br>MicrosoftVBscript运行时错误(0x000A004A) 重命名时不能带有其他驱动器符号<br>MicrosoftVBscript运行时错误(0x000A004B) 路径/文件访问错误<br>MicrosoftVBscript运行时错误(0x000A004C) 路径未找到<br>MicrosoftVBscript运行时错误(0x000A005B) 对象变量未设置<br>MicrosoftVBscript运行时错误(0x000A005C) For 循环未初始化<br>MicrosoftVBscript运行时错误(0x000A005E) 无效使用 Null<br>MicrosoftVBscript运行时错误(0x000A0142) 不能创建必要的临时文件<br>MicrosoftVBscript运行时错误(0x000A01A8) 缺少对象<br>MicrosoftVBscript运行时错误(0x000A01AD) ActiveX 部件不能创建对象<br>MicrosoftVBscript运行时错误(0x000A01AE) 类不支持 Automation 操作<br>MicrosoftVBscript运行时错误(0x000A01B0) Automation 操作中文件名或类名未找到<br>MicrosoftVBscript运行时错误(0x000A01B6) 对象不支持此属性或方法<br>MicrosoftVBscript运行时错误(0x000A01B8) Automation 操作错误<br>MicrosoftVBscript运行时错误(0x000A01BD) 对象不支持此操作<br>MicrosoftVBscript运行时错误(0x000A01BE) 对象不支持已命名参数<br>MicrosoftVBscript运行时错误(0x000A01BF) 对象不支持当前区域设置选项<br>MicrosoftVBscript运行时错误(0x000A01C0) 未找到已命名参数<br>MicrosoftVBscript运行时错误(0x000A01C1) 参数是必选项<br>MicrosoftVBscript运行时错误(0x000A01C2) 错误的参数个数或无效的参数属性值<br>MicrosoftVBscript运行时错误(0x000A01C3) 对象不是一个集合<br>MicrosoftVBscript运行时错误(0x000A01C5) 未找到指定的 DLL 函数<br>MicrosoftVBscript运行时错误(0x000A01C7) 代码资源锁定错误<br>MicrosoftVBscript运行时错误(0x000A01C9) 此键已与该集合的一个元素关联<br>MicrosoftVBscript运行时错误(0x000A01CA) 变量使用了一个 VBScript 中不支持的 Automation 类型<br>MicrosoftVBscript运行时错误(0x000A01CE) 远程服务器不存在或不可用<br>MicrosoftVBscript运行时错误(0x000A01E1) 无效图片<br>MicrosoftVBscript运行时错误(0x000A01F4) 变量未定义<br>MicrosoftVBscript运行时错误(0x000A01F5) 非法赋值<br>MicrosoftVBscript运行时错误(0x000A01F6) 对象不能安全用 Script 编程<br>MicrosoftVBscript运行时错误(0x000A01F7) 对象不能安全初始化<br>MicrosoftVBscript运行时错误(0x000A01F8) 对象不能安全创建<br>MicrosoftVBscript运行时错误(0x000A01F9) 无效的或无资格的引用<br>MicrosoftVBscript运行时错误(0x000A01FA) 类没有被定义<br>MicrosoftVBscript运行时错误(0x000A01FB) 出现一个意外错误<br>MicrosoftVBscript运行时错误(0x000A03E9) 内存不够<br>MicrosoftVBscript运行时错误(0x000A03EA) 语法错误<br>MicrosoftVBscript运行时错误(0x000A03EB) 缺少 ‘:‘<br>MicrosoftVBscript运行时错误(0x000A03ED) 缺少 ‘(‘<br>MicrosoftVBscript运行时错误(0x000A03EE) 缺少 ‘)‘<br>MicrosoftVBscript运行时错误(0x000A03EF) 缺少 ‘]‘<br>MicrosoftVBscript运行时错误(0x000A03F2) 缺少标识符<br>MicrosoftVBscript运行时错误(0x000A03F3) 缺少 ‘=‘<br>MicrosoftVBscript运行时错误(0x000A03F4) 缺少 ‘If‘<br>MicrosoftVBscript运行时错误(0x000A03F5) 缺少 ‘To‘<br>MicrosoftVBscript运行时错误(0x000A03F6) 缺少 ‘End‘<br>MicrosoftVBscript运行时错误(0x000A03F7) 缺少 ‘Function‘<br>MicrosoftVBscript运行时错误(0x000A03F8) 缺少 ‘Sub‘<br>MicrosoftVBscript运行时错误(0x000A03F9) 缺少 ‘Then‘<br>MicrosoftVBscript运行时错误(0x000A03FA) 缺少 ‘Wend‘<br>MicrosoftVBscript运行时错误(0x000A03FB) 缺少 ‘Loop‘<br>MicrosoftVBscript运行时错误(0x000A03FC) 缺少 ‘Next‘<br>MicrosoftVBscript运行时错误(0x000A03FD) 缺少 ‘Case‘<br>MicrosoftVBscript运行时错误(0x000A03FE) 缺少 ‘Select‘<br>MicrosoftVBscript运行时错误(0x000A03FF) 缺少表达式<br>MicrosoftVBscript运行时错误(0x000A0400) 缺少语句<br>MicrosoftVBscript运行时错误(0x000A0401) 语句未结束<br>MicrosoftVBscript运行时错误(0x000A0402) 缺少整型常数<br>MicrosoftVBscript运行时错误(0x000A0403) 缺少 ‘While‘ 或 ‘Until‘<br>MicrosoftVBscript运行时错误(0x000A0404) 缺少 ‘While‘ 和 ‘Until‘或语句未结束<br>MicrosoftVBscript运行时错误(0x000A0405) 缺少 ‘With‘<br>MicrosoftVBscript运行时错误(0x000A0406) 标识符过长<br>MicrosoftVBscript运行时错误(0x000A0407) 无效数字<br>MicrosoftVBscript运行时错误(0x000A0408) 无效字符<br>MicrosoftVBscript运行时错误(0x000A0409) 未结束的字符串常量<br>MicrosoftVBscript运行时错误(0x000A040A) 注释未结束<br>MicrosoftVBscript运行时错误(0x000A040D) 无效使用 ‘Me‘ 关键字<br>MicrosoftVBscript运行时错误(0x000A040E) ‘loop‘ 语句缺少 ‘do‘<br>MicrosoftVBscript运行时错误(0x000A040F) 无效的 ‘exit‘ 语句<br>MicrosoftVBscript运行时错误(0x000A0410) 循环控制变量 ‘for‘ 无效<br>MicrosoftVBscript运行时错误(0x000A0411) 名称重定义<br>MicrosoftVBscript运行时错误(0x000A0412) 必须是行中的第一个语句<br>MicrosoftVBscript运行时错误(0x000A0413) 不能为 non-ByVal 参数赋值<br>MicrosoftVBscript运行时错误(0x000A0414) 调用子程序时不能使用括号<br>MicrosoftVBscript运行时错误(0x000A0415) 缺少文字常数<br>MicrosoftVBscript运行时错误(0x000A0416) 缺少 ‘In‘<br>MicrosoftVBscript运行时错误(0x000A0417) 缺少 ‘Class‘<br>MicrosoftVBscript运行时错误(0x000A0418) 必须在一个类的内部定义<br>MicrosoftVBscript运行时错误(0x000A0419) 在属性声明中缺少 Let , Set 或 Get<br>MicrosoftVBscript运行时错误(0x000A041A) 缺少 ‘Property‘<br>MicrosoftVBscript运行时错误(0x000A041B) 在所有属性的规范中,变量的数目必须一致<br>MicrosoftVBscript运行时错误(0x000A041C) 在一个类中不允许有多个缺省的属性/方法<br>MicrosoftVBscript运行时错误(0x000A041D) 类的初始化或终止程序没有变量<br>MicrosoftVBscript运行时错误(0x000A041E) 属性的 set 或 let 必须至少有一个变量<br>MicrosoftVBscript运行时错误(0x000A041F) 错误的 ‘Next‘<br>MicrosoftVBscript运行时错误(0x000A0420) ‘Default‘ 只能在 ‘Property‘ , ‘Function‘ 或 ‘Sub‘ 中指定<br>MicrosoftVBscript运行时错误(0x000A0421) 指定 ‘Default‘ 时必须同时指定 ‘Public‘<br>MicrosoftVBscript运行时错误(0x000A0422) 只能在 Property Get 中指定 ‘Default‘<br>MicrosoftVBscript运行时错误(0x000A1000) Microsoft VBScript 编译器错误<br>MicrosoftVBscript运行时错误(0x000A1001) Microsoft VBScript 运行时错误<br>MicrosoftVBscript运行时错误(0x000A1398) 缺少正则表达式对象<br>MicrosoftVBscript运行时错误(0x000A1399) 正则表达式语法错误<br>MicrosoftVBscript运行时错误(0x000A139A) 错误的数量词<br>MicrosoftVBscript运行时错误(0x000A139B) 正则表达式中缺少 ‘]‘<br>MicrosoftVBscript运行时错误(0x000A139C) 正则表达式中缺少 ‘)‘<br>MicrosoftVBscript运行时错误(0x000A139D) 字符集越界</p> <p>10进制表示,希望actor2222 (优悠) 能看到</p> <p>MicrosoftVBscript运行时错误列表(10进制表示)</p> <p>error # 5 无效的过程调用或参数<br>error # 5 无效的过程调用或参数<br>error # 6 溢出<br>error # 7 内存不够<br>error # 9 下标越界<br>error # 10 该数组为定长的或临时被锁定<br>error # 11 被零除<br>error # 13 类型不匹配<br>error # 14 字符串空间不够<br>error # 17 不能执行所需的操作<br>error # 28 堆栈溢出<br>error # 35 未定义过程或函数<br>error # 48 加载 DLL 时出错<br>error # 51 内部错误<br>error # 52 错误的文件名或号码<br>error # 53 文件未找到<br>error # 54 错误的文件模式<br>error # 55 文件已经打开<br>error # 57 设备 I/O 错误<br>error # 58 文件已存在<br>error # 61 磁盘已满<br>error # 62 输入超出了文件尾<br>error # 67 文件过多<br>error # 68 设备不可用<br>error # 70 没有权限<br>error # 71 磁盘没有准备好<br>error # 74 重命名时不能带有其他驱动器符号<br>error # 75 路径/文件访问错误<br>error # 76 路径未找到<br>error # 91 对象变量未设置<br>error # 92 For 循环未初始化<br>error # 94 无效使用 Null<br>error # 322 不能创建必要的临时文件<br>error # 424 缺少对象<br>error # 429 ActiveX 部件不能创建对象<br>error # 430 类不支持 Automation 操作<br>error # 432 Automation 操作中文件名或类名未找到<br>error # 438 对象不支持此属性或方法<br>error # 440 Automation 操作错误<br>error # 445 对象不支持此操作<br>error # 446 对象不支持已命名参数<br>error # 447 对象不支持当前区域设置选项<br>error # 448 未找到已命名参数<br>error # 449 参数是必选项<br>error # 450 错误的参数个数或无效的参数属性值<br>error # 451 对象不是一个集合<br>error # 453 未找到指定的 DLL 函数<br>error # 455 代码资源锁定错误<br>error # 457 此键已与该集合的一个元素关联<br>error # 458 变量使用了一个 VBScript 中不支持的 Automation 类型<br>error # 462 远程服务器不存在或不可用<br>error # 481 无效图片<br>error # 500 变量未定义<br>error # 501 非法赋值<br>error # 502 对象不能安全用 Script 编程<br>error # 503 对象不能安全初始化<br>error # 504 对象不能安全创建<br>error # 505 无效的或无资格的引用<br>error # 506 类没有被定义<br>error # 507 出现一个意外错误<br>error # 1001 内存不够<br>error # 1002 语法错误<br>error # 1003 缺少 ‘:‘<br>error # 1005 缺少 ‘(‘<br>error # 1006 缺少 ‘)‘<br>error # 1007 缺少 ‘]‘<br>error # 1010 缺少标识符<br>error # 1011 缺少 ‘=‘<br>error # 1012 缺少 ‘If‘<br>error # 1013 缺少 ‘To‘<br>error # 1014 缺少 ‘End‘<br>error # 1015 缺少 ‘Function‘<br>error # 1016 缺少 ‘Sub‘<br>error # 1017 缺少 ‘Then‘<br>error # 1018 缺少 ‘Wend‘<br>error # 1019 缺少 ‘Loop‘<br>error # 1020 缺少 ‘Next‘<br>error # 1021 缺少 ‘Case‘<br>error # 1022 缺少 ‘Select‘<br>error # 1023 缺少表达式<br>error # 1024 缺少语句<br>error # 1025 语句未结束<br>error # 1026 缺少整型常数<br>error # 1027 缺少 ‘While‘ 或 ‘Until‘<br>error # 1028 缺少 ‘While‘ 和 ‘Until‘或语句未结束<br>error # 1029 缺少 ‘With‘<br>error # 1030 标识符过长<br>error # 1031 无效数字<br>error # 1032 无效字符<br>error # 1033 未结束的字符串常量<br>error # 1034 注释未结束<br>error # 1037 无效使用 ‘Me‘ 关键字<br>error # 1038 ‘loop‘ 语句缺少 ‘do‘<br>error # 1039 无效的 ‘exit‘ 语句<br>error # 1040 循环控制变量 ‘for‘ 无效<br>error # 1041 名称重定义<br>error # 1042 必须是行中的第一个语句<br>error # 1043 不能为 non-ByVal 参数赋值<br>error # 1044 调用子程序时不能使用括号<br>error # 1045 缺少文字常数<br>error # 1046 缺少 ‘In‘<br>error # 1047 缺少 ‘Class‘<br>error # 1048 必须在一个类的内部定义<br>error # 1049 在属性声明中缺少 Let , Set 或 Get<br>error # 1050 缺少 ‘Property‘<br>error # 1051 在所有属性的规范中,变量的数目必须一致<br>error # 1052 在一个类中不允许有多个缺省的属性/方法<br>error # 1053 类的初始化或终止程序没有变量<br>error # 1054 属性的 set 或 let 必须至少有一个变量<br>error # 1055 错误的 ‘Next‘<br>error # 1056 ‘Default‘ 只能在 ‘Property‘ , ‘Function‘ 或 ‘Sub‘ 中指定<br>error # 1057 指定 ‘Default‘ 时必须同时指定 ‘Public‘<br>error # 1058 只能在 Property Get 中指定 ‘Default‘<br>error # 4096 Microsoft VBScript 编译器错误<br>error # 4097 Microsoft VBScript 运行时错误<br>error # 5016 缺少正则表达式对象<br>error # 5017 正则表达式语法错误<br>error # 5018 错误的数量词<br>error # 5019 正则表达式中缺少 ‘]‘<br>error # 5020 正则表达式中缺少 ‘)‘<br>error # 5021 字符集越界</p> <p><br>利用ASP获得图象的实际尺寸的示例<br><!--#include virtual="/learn/test/lib_graphicdetect.asp"--><br><html><head><br><TITLE>dbtable.asp


<%
graphic="images/learnaspiconmain.gif"
HW = ReadImg(graphic)
Response.Write graphic & " Dimensions: " & HW(0) & "x" & HW(1)
& "
"
response.write "response.write height=""" & HW(0) & """
response.write width=""" & HW(0) & "">"
%>

 

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://检验内容的长度
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://检验长度
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://焦点控制
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"将彻底屏蔽鼠标右键
no可用于table
2.取消选取、防止复制
3.onpaste="returnfalse"不准粘贴
4.oncopy="returnfalse;"oncut="returnfalse;"防止复制
5.ie地址栏前换成自己的图标
6.可以在收藏夹中显示出你的图标
7.关闭输入法
8.永远都会带着框架

9.防止被人frame

10.网页将不能被另存为
11.onclick="window.location=view-source:+ http://www.csdn.net/";;;;>
12.怎样通过asp的手段来检查来访者是否用了代理
<%ifrequest.servervariables("http_x_forwarded_for")<>""then
response.write"您通过了代理服务器,"&_
"真实的ip为"&request.servervariables("http_x_forwarded_for")
endif
"%>
<% response.write"
13.取得控件的绝对位置
file://javascript

functiongetie(e){
vart=e.offsettop;
varl=e.offsetleft;
while(e=e.offsetparent){
t+=e.offsettop;
l+=e.offsetleft;
}
alert("top="+t+"\nleft="+l);
}

file://vbscript

14.光标是停在文本框文字的最后

functioncc()
{
vare=event.srcelement;
varr=e.createtextrange();
r.movestart(character,e.value.length);
r.collapse(true);
r.select();
}


15.判断上一页的来源
asp:
request.servervariables("http_referer")
java script:
document.referrer
16.最小化、最大化、关闭窗口









本例适用于ie
17.
<%
定义数据库连接的一些常量
constadopenforwardonly=0游标只向前浏览记录,不支持分页、recordset、bookmark
constadopenkeyset=1键集游标,其他用户对记录说做的修改将反映到记录集中,但其他用户增加或删除记录不会反映到记录集中。支持分页、recordset、bookmark
constadopendynamic=2动态游标功能最强,但耗资源也最多。用户对记录说做的修改,增加或删除记录都将反映到记录集中。支持全功能浏览(access不支持)。
constadopenstatic=3静态游标,只是数据的一个快照,用户对记录说做的修改,增加或删除记录都不会反映到记录集中。支持向前或向后移动
constadlockreadonly=1锁定类型,默认的,只读,不能作任何修改
constadlockpessimistic=2当编辑时立即锁定记录,最安全的方式
constadlockoptimistic=3只有在调用update方法时才锁定记录集,而在此前的其他操作仍可对当前记录进行更改、插入和删除等
constadlockbatchoptimistic=4当编辑时记录不会被锁定,而更改、插入和删除是在批处理方式下完成的
constadcmdtext=&h0001
constadcmdtable=&h0002
" %>
18.网页不会被缓存
htm网页



或者
asp网页
response.expires=-1
response.expiresabsolute=now()-1
response.cachecontrol="no-cache"
php网页
header("expires:mon,26jul199705:00:00gmt");
header("cache-control:no-cache,must-revalidate");
header("pragma:no-cache");

19.检查一段字符串是否全由数字组成

20.获得一个窗口的大小
document.body.clientwidth,document.body.clientheight


21.怎么判断是否是字符
if(/[^\x00-\xff]/g.test(s))alert("含有汉字");
elsealert("全是字符");
22.textarea自适应文字行数的多少


23.日期减去天数等于第二个日期

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)

24.选择了哪一个radio

functioncheckme()
foreachobinradio1
ifob.checkedthenwindow.alertob.value
next
endfunction

style
barcode


25.获得本页url的request.servervariables("")集合
response.write"variablesvalue"
foreachobinrequest.servervariables
response.write""&ob&""&request.servervariables(ob)&""
next
response.write""
26.
本机ip<%=request.servervariables("remote_addr")%>
服务器名<%=request.servervariables("server_name")%>
服务器ip<%=request.servervariables("local_addr")%>
服务器端口<%=request.servervariables("server_port")%>
服务器时间<%=now%>
iis版本<%=request.servervariables"server_software")%>
脚本超时时间<%=server.scripttimeout%>
本文件路径<%=server.mappath(request.servervariables("script_name"))%>
服务器cpu数量<%=request.servervariables("number_of_processors")%>
服务器解译引擎<%=scriptengine&"/" & scriptenginemajorversion &"." & scriptengineminorversion & "." & scriptenginebuildversion%>
服务器操作系统<%=request.servervariables("os")%>
27.enter键可以让光标移到下一个输入框

28.检测某个网站的链接速度:
把如下代码加入区域中:

tim=1
setinterval("tim++",100)
b=1
varautourl=newarray()
autourl[1]="< src="pic/url.gif" align=absmiddle border=0> www.njcatv.net"
autourl[2]="javacool.3322.net"
autourl[3]="< src="pic/url.gif" align=absmiddle border=0> www.sina.com.cn"
autourl[4]="www.nuaa.edu.cn"
autourl[5]="< src="pic/url.gif" align=absmiddle border=0> www.cctv.com"
functionbutt(){
document.write("")
for(vari=1;idocument.write("=》=》
")
document.write("")
}
butt()
functionauto(url){
document.forms[0]["url"+b].value=url
if(tim>200)
{document.forms[0]["txt"+b].value="链接超时"}
else
{document.forms[0]["txt"+b].value="时间"+tim/10+"秒"}
b++
}
functionrun(){for(vari=1;i ")}/">http://";;;;;+autourl+")>")}
run()

29.各种样式的光标
auto:标准光标
default:标准箭头
hand:手形光标
wait:等待光标
text:i形光标
vertical-text:水平i形光标
no-drop:不可拖动光标
not-allowed:无效光标
help:?帮助光标
all-scroll:三角方向标
move:移动标
crosshair:十字标
e-resize
n-resize
nw-resize
w-resize
s-resize
se-resize
sw-resize
1.本地无缓存,每次自动刷新
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.检查一段字符串是否全由数字组成

20.获得一个窗口的大小
document.body.clientwidth,document.body.clientheight
document.body.offsetwidth,document.body.offsetheight
有时还需要知道window.screentop,window.screenleft
21.怎么判断是否含有汉字
if(escape(str).indexof("%u")!=-1)alert("含有汉字");
elsealert("全是字符");
22.textarea自适应文字行数的多少
ie5.5+可以用overflow-y:visible


23.日期减去天数等于第二个日期

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)