This is correct if you return the input ID, or you will be prompted for an error
Function Checkcardid (E)
Arrverifycode = Split ("1,0,x,9,8,7,6,5,4,3,2", ",")
Wi = Split ("7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2", ",")
Checker = Split ("1,9,8,7,6,5,4,3,2,1,1", ",")
If Len (E) < or Len (e) = or Len (e) = or Len (e) > Then
Checkcardid= "ID number is 15 yards or 18 digits."
Checkcardid = False
Exit Function
End If
Dim Ai
If Len (e) = Then
Ai = Mid (E, 1, 17)
ElseIf Len (e) = Then
Ai = E
Ai = Left (AI, 6) & "A" & Mid (AI, 7, 9)
End If
If not IsNumeric (Ai) Then
Checkcardid= "ID card in addition to the last one, must be a number!" "
Exit Function
End If
Dim stryear, Strmonth, Strday
Stryear = CInt (Mid (Ai, 7, 4))
Strmonth = CInt (Mid (Ai, 11, 2))
Strday = CInt (Mid (Ai, 13, 2))
Birthday = Trim (stryear) + "-" + trim (strmonth) + "-" + trim (strday)
If IsDate (Birthday) Then
If DateDiff ("yyyy", now,birthday) <-140 or CDate (birthday) > date () Then
Checkcardid= "ID card input Error! "
Exit Function
End If
If strmonth > Or strday > Then
Checkcardid= "ID card input Error! "
Exit Function
End If
Else
Checkcardid= "ID card input Error! "
Exit Function
End If
Dim I, Totalmulaiwi
For i = 0 to 16
Totalmulaiwi = Totalmulaiwi + CInt (Mid (Ai, i + 1, 1)) * Wi (i)
Next
Dim Modvalue
Modvalue = Totalmulaiwi Mod 11
Dim Strverifycode
Strverifycode = Arrverifycode (modvalue)
ai = ai & Strverifycode
Checkcardid = Ai
If Len (e) = e <> Ai Then
Checkcardid= "ID card number input Error! "
Exit Function
End If
End Function
Response.Write Checkcardid ("528337194801020025") "'