If strCardNum.Length <> 5 Then
MessageBox.Show("Please enter a 5 numbers.", _
"Georgetown Credit", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
ElseIf Not (Integer.TryParse(strCardNum.Substring(0, 1), intNum1) _
OrElse Integer.TryParse(strCardNum.Substring(1, 1), intNum2) _
OrElse Integer.TryParse(strCardNum.Substring(2, 1), intNum3) _
OrElse Integer.TryParse(strCardNum.Substring(3, 1), intNum4) _
OrElse Integer.TryParse(strCardNum.Substring(4, 1), intNum5)) Then
MessageBox.Show("The card number entered is not number")
Else
intSumNum = intNum1 + (intNum2 * 2) + intNum3 + (intNum4 * 2)
intSumNum = Convert.ToInt32(strSumNum)(it won't accept this, how do I get this part convert?)
If intNum5.ToString() = (strSumNum.Substring(2, 1)) Then
Me.lblCreditCard.Text = "The credit card number is valid."
Else
Me.lblCreditCard.Text = "The credit card number is invalid."
End If
End If
Vikijo 0 Newbie Poster
Vikijo 0 Newbie Poster
Vikijo 0 Newbie Poster
cguan_77 8 Nearly a Posting Virtuoso
AndreRet 526 Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.