当前位置: 首页 > 图文教程 > 脚本技术 > VBScript > 防SQL注入的VBSrcipt代码

VBScript
VBS教程:正则表达式简介 -定位符
VBS教程:正则表达式简介 -限定符
VBS教程:正则表达式简介 -字符匹配
VBS教程:正则表达式简介 -非打印字符
VBS教程:正则表达式简介 -特殊字符
VBS教程:正则表达式简介 -普通字符
VBS教程:正则表达式简介 -优先权顺序
VBS教程:正则表达式简介 -建立正则表达式
VBS教程:正则表达式简介 -正则表达式语法
VBS教程:正则表达式简介 -使用正则表达式
VBS教程:正则表达式简介 -早期起源
VBS教程:正则表达式简介 -正则表达式
VBS教程:正则表达式简介
VBS教程:属性-VolumeName 属性
VBS教程:属性-Type 属性
VBS教程:属性-TotalSize 属性
VBS教程:属性-SubFolders 属性
VBS教程:属性-Size 属性
VBS教程:属性-ShortPath 属性
VBS教程:属性-ShortName 属性

VBScript 中的 防SQL注入的VBSrcipt代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-11   浏览: 50 ::
收藏到网摘: n/a

<script language="vbscript">
function checkstr(strname)
strn=trim(strname.value)
str=trim(strname.value)
for i=1 to len(str)
strcheck=asc(left(str,1))
if not ((strcheck=<122 and strcheck>=97) or (strcheck<=90 and strcheck>=65) or (strcheck<=57 and strcheck>=48)) then
msgbox("请勿使用除英文字母及数字以外的字符!")
strname.value = left(strn,i-1)
strname.focus
exit for
end if
str=Right(str,len(str)-1)
next
end function
function checknum()
checknum=true
if not document.all.txtMailSize.value="" then
if not IsNumeric(document.all.txtMailSize.value) then
msgbox("请勿使用数字以外的字符!")
document.all.txtMailSize.value=""
document.all.txtMailSize.focus
checknum=false
else if document.all.txtMailSize.value>5 or document.all.txtMailSize.value<0 then
msgbox("请填写5-0之间的数字!")
document.all.txtMailSize.value=""
document.all.txtMailSize.focus
checknum=false
end if
end if
end if
end function
function checkupdate()
checkupdate=true
if document.all.txtU_name.value="" or document.all.txtMailSize.value="" then
msgbox("您填写的信息不完全!")
checkupdate=false
end if
end function
function compare()
compare=true
if not document.all.txtRePsw.value =document.all.txtPsw.value then
msgbox("两次密码输入不一致!")
document.all.txtRePsw.focus
compare=false
end if
end function