防SQL注入的VBSrcipt代碼
更新時間:2007年03月09日 00:00:00 作者:
<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("請勿使用除英文字母及數(shù)字以外的字符!")
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("請勿使用數(shù)字以外的字符!")
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("請?zhí)顚?-0之間的數(shù)字!")
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
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("請勿使用除英文字母及數(shù)字以外的字符!")
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("請勿使用數(shù)字以外的字符!")
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("請?zhí)顚?-0之間的數(shù)字!")
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
相關文章
網(wǎng)絡接口利用率監(jiān)控VBS腳本代碼(Windows)
監(jiān)測windows主機網(wǎng)絡接口利用率的vbs代碼,需要的朋友可以參考下。2011-12-12VBS教程:VBScript 語句-Property Let 語句
VBS教程:VBScript 語句-Property Let 語句...2006-11-11