ThaiNational IDCard(Smartcard) helper
Switch branches/tags
Nothing to show
Clone or download
chakphanu Merge pull request #11 from ThisIsVegas/pcsc-4.0.0
Updated pcsc-sharp to PCSC 4.0.0 and added support for RAW protocol
Latest commit 33be4f5 May 17, 2018

README.md

ThaiNationalIDCard

Credit: APDU Command from Mr.Manoi http://hosxp.net/index.php?option=com_smf&topic=22496

ThaiNational IDCard(Smartcard) helper

To install ThaiNationalIDCard, run the following command in the Package Manager Console

PM> Install-Package ThaiNationalIDCard

Credit 3B 78 Type of thai smartcard See on wiki. https://github.com/kolry/ThaiNationalIDCard/wiki/_pages

using ThaiNationalIDCard;
...
...
public void readCard()
{
            ThaiIDCard idcard = new ThaiIDCard();
            Personal personal = idcard.readAll();
            if (personal != null)
            {
                Console.WriteLine(personal.Citizenid);
                Console.WriteLine(personal.Birthday.ToString("dd/MM/yyyy"));
                Console.WriteLine(personal.Sex);
                Console.WriteLine(personal.Th_Prefix);
                Console.WriteLine(personal.Th_Firstname);
                Console.WriteLine(personal.Th_Lastname);
                Console.WriteLine(personal.En_Prefix);
                Console.WriteLine(personal.En_Firstname);
                Console.WriteLine(personal.En_Lastname);
                Console.WriteLine(personal.Issue.ToString("dd/MM/yyyy")); // วันออกบัตร
                Console.WriteLine(personal.Expire.ToString("dd/MM/yyyy")); // วันหมดอายุ

                Console.WriteLine(personal.Address);
                Console.WriteLine(personal.addrHouseNo); // บ้านเลขที่
                Console.WriteLine(personal.addrVillageNo); // หมู่ที่
                Console.WriteLine(personal.addrLane); // ซอย
                Console.WriteLine(personal.addrRoad); // ถนน
                Console.WriteLine(personal.addrTambol);
                Console.WriteLine(personal.addrAmphur);
                Console.WriteLine(personal.addrProvince);
            }
            else if (idcard.ErrorCode() > 0)
            {
                Console.WriteLine(idcard.Error());
            }
}