• λ我爱Aspx >> Asp.Net >> Asp自定义函数参考
  • Asp自定义函数参考

  • :未知  Դ:internet  :2007-5-20 16:39:49  ؼ: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

    Ҷƪл˵?
  • һƪ购物推车设计8个方法
    һƪASP数据库连接