Validate Credit Card Number

2007-12-22 6:03 am
I want use visual studio 2005 web development asp.net to write a shopping cart code behind is VB i want to ask how to write validation of credit card number ?

回答 (1)

2007-12-22 9:07 am
✔ 最佳答案
Credit card numbers are not random numbers. Every credit card number includes a check digit in its number so that the number can be verified with a formula known as Luhn formula.

These sites may help you. The programs are written in C but you can easily translate them to VB.

http://www.codeguru.com/csharp/.net/net_security/authentication/article.php/c12283
http://en.wikipedia.org/wiki/Luhn_formula

The validation formula can only verify if the credit card number conforms to the formula but it cannot tell if the credit card number is valid. But it is a good thing to do before submitting the transaction to the credit card company.


收錄日期: 2021-04-23 17:35:34
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20071221000051KK03551

檢視 Wayback Machine 備份