萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> asp編程 >> asp 特殊字符屏蔽代碼

asp 特殊字符屏蔽代碼

function strreplace(str)
 if str = "" then
  strreplace = str
 else
  strreplace = replace(str,"'","''")
 end if
end function
檢測數字函數
function check_num(str)
   dim i
   For i = 1 To Len(str)
  
     if  Asc(Mid(str, i, 1)) < 48  or   Asc(Mid(str, i, 1)) > 57 then
          check_num=false
    exit function
     else
       check_num=true
     end if
   Next
end function

function cutstr(str,strlen,more,url)
if len(str)>strlen then
  str=left(str,strlen) & "......"
End if
if (len(str)>strlen) and more then
  str=str+"&nbsp;&nbsp;&nbsp;[url="+url+"]點這裡查看詳情[/url]"
End if
cutstr=str
End function

copyright © 萬盛學電腦網 all rights reserved