Senin, 14 Juni 2010
Credit Card Validation Check by Code
private bool CheckIsValidCreditCard(string CreditCard){ bool IsValidCreditCard = false; int sum = 0; int MultiplyDigit = 0; for (int i = 0; i < CreditCard.Length; i++) { if (i % 2 == 0) { MultiplyDigit = Convert.ToInt32(CreditCard.Substring(i, 1)) * 2; if (MultiplyDigit > 9) sum += MultiplyDigit - 9; else sum += MultiplyDigit;
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar