Here's some code in C# that uses the Luhn algorithm to validate a Visa credit card:
main.cs1091 chars45 lines
To use this method, simply pass in a string containing the credit card number to be validated. The method will return true if the card number is valid, and false otherwise.
gistlibby LogSnag