Vb. NET code verifies that the credit card number is correct, this code uses the Luhn algorithm to verify
Dim Creditcardnumber as String
creditcardnumber = "1234567891234563" Please enter the number you want to verify by yourself
If Creditcardnumber.length < Then
Page.ClientScript.RegisterStartupScript (Me.GetType (), "DD", "alert (' Error number only "& Creditcardnumber.length & Password"; ", True)
Else
Dim Int
as Integer Dim x, num, Sun as integer
for x = 0
to num = creditcardnumber.substring (x, 1)
If (x + 1) Mod 2 <> 0 Then ' Even multiply 1 odd number by 2
Int (x) = n UM * 2
Else
Int (x) = num End
If
Next for
x = 0 to
(int (x) > 9) Then
Int (x) = ( int (x) Mod + 1 End
If
sun + = Int (x)
Next
If (Sun Mod = 0) Then
Page.ClientScript.RegisterS Tartupscript (Me.GetType (), "ddd", "alert (' correct credit card ');", True)
Else
Page.ClientScript.RegisterStartupScript (Me.GetType (), "DD", "alert (' Error);", True) end
if
The above mentioned is the entire content of this article, I hope to learn vb.net can help.