我爱Aspx >> Asp.Net >> Asp自定义函数参考Asp自定义函数参考
判断输入域名是否正确的函数:
dim c,words,word,i,wnumfunction IsValiddomin(word)IsValiddomin = truewords = Split(word, ".")wnum=UBound(words)if words(0)="www" thenIsValiddomin = IsValidword(words(1))IsValiddomin = IsValidword2(words(2))if words(wnum)="cn" thenif wnum<>3 thenIsValiddomin = falseexit functionend ifelseif wnum<>2 thenIsValiddomin = falseexit functionend ifend ifelseIsValiddomin = IsValidword(words(0))IsValiddomin = IsValidword2(words(1))if words(wnum)="cn" thenif wnum<>2 thenIsValiddomin = falseexit functionend ifelseif wnum<>1 thenIsValiddomin = falseexit functionend ifend ifend ifend functionfunction IsValidword2(word)IsValidword2 = trueIsValidword2 = IsValidword(word)if word<>"net" and word<>"com" and word<>"cc" and word<>"org" and word<>"info" and word<>"gov" then 自己添加IsValidword2 = falseexit functionend ifend functionfunction IsValidword(word)IsValidword = trueif Len(word) <= 0 thenIsValidword = falseexit functionend iffor i = 1 to Len(word)c = Lcase(Mid(word, i, 1))if InStr("abcdefghijklmnopqrstuvwxyz-", c) <= 0 and not IsNumeric(c) thenIsValidword = falseexit functionend ifnextend functionif IsValiddomin("wrclub.net.cn") thenresponse.write "right"elseresponse.write "wrong"end if
Ҷƪл˵?
ASP数据库连接[05-20]
ASP中使用存储过程[05-20]
ASP与数据库连接的问题[05-20]
asp溢出漏洞[05-20]
ASP连动下拉列表从数据库读取[05-20]
asp防注入函数[05-20]
ASP中返回上一页[05-20]
asp编程有用的例子(二)[05-20]
ASP程序中同一个用户不允许同时登..[05-20]
asp编程有用的例子(一)[05-20]
ASP数据库连接[05-20]
ASP中使用存储过程[05-20]
ASP与数据库连接的问题[05-20]
asp溢出漏洞[05-20]
ASP连动下拉列表从数据库读取[05-20]
asp防注入函数[05-20]
ASP中返回上一页[05-20]
asp编程有用的例子(二)[05-20]
ASP程序中同一个用户不允许同时登..[05-20]
JavaScript通用表单验证函数[05-20]