2013年3月27日 星期三

ASP 身分驗證


Function CheckID(ID)
 ID = UCase(ID)
 Dim regEx, retVal,IDChk,msg      ' 建立變量。
 Set regEx = New RegExp ' 建立正則表達式。
 regEx.Pattern = "([A-Z]{1}[12]{1}[0-9]{8}|[A-Z]{1}[ABCD]{1}[0-9]{8})" ' 設置模式。
 regEx.IgnoreCase = False ' 設置是否區分大小寫。
 retVal = regEx.Test(ID) ' 執行搜索測試。
 If retVal Then
         IDChk = True: msg = "身分證正確!!"
 Else
         msg = "身分證輸入錯誤,請再檢查!"    
 End If
 CheckID = IDChK
END FUNCTION

0 個意見:

張貼留言

訂閱 張貼留言 [Atom]

<< 首頁