This project is read-only.

Algoritmos validación NIF

Coordinator
Oct 2, 2007 at 10:45 PM

He visto esto en: http://geeks.ms/blogs/eecsaky/archive/2007/08/29/tip-trick-validar-un-dni.aspx

bool validarDNI(string dni)

{

return (new Regex("0-9{8}A-Za-z").Match(dni).Success)?

("TRWAGMYFPDXBNJZSQVHLCKE"(int)long.Parse(dni.Substring(0, 8)) % 23.ToString() ==

dni.ToUpper()):false;

}