ID Parsing Library for .NET
DL/ID Parsing Library
DL/ID cards are widely used for storing personal information such as first name, last name, birth date, address, etc. They also contain special information related to driving such as Driver's License Number, Driver's License Class and restrictions placed on your Driver's License by the Issuing Jurisdiction. Because of the usefulness of this data, there is a high demand for systems that can scan and process Identification Documents.
To meet this level of industry demand, IDScan.net developed a DL/ID Parsing library for multiple development environments. The entire list can be found on our download page. To build this library we have collected more than 10 years of ID formats from the United States, Canada, and many other countries around the world. All these different formats have been used to build an incredibly robust parsing library that has been tested thoroughly to ensure every DL/ID card is parsed with precision.
Implementation Instructions Using Microsoft Visual Studio
for .NET languages
- Download dlplib from the link below and extract files.
- With your project open, go to Project -> Add COM Reference
- Go to the Browse tab and click the Browse button
- Browse the path to IDScanNet.dlplib.dll and click the "Add" button.
- After that, click OK.
- Now you are ready to write a program. Let’s write a simple example:
using Nautilus;
//...
static void Main(string[] args)
{
// This is necessary to obtain a license
Console.WriteLine($"ComputerId:{DriverLicense.ComputerId}");
string scanned_text = File.ReadAllText(@"C:\Project\DlpLib-Demo_WinFormsNetCore\testdl.txt");
DriverLicense result = DriverLicense.ParseText(scanned_text);
if(result != null)
{
Console.WriteLine($"FirstName:{result.FirstName}");
Console.WriteLine($"FullName:{result.FullName}");
Console.WriteLine($"LastName:{result.LastName}");
Console.WriteLine($"LicenseNumber:{result.LicenseNumber}");
}
Console.ReadLine();
}
.NET ID Parsing Library (for .NET Framework version 4.6.1 or later, .NET CORE version 2.0 or later) – Download
.NET ID Parsing Library (for .NET Framework 4.0 - 4.6) – Download
C# Example Project for SDK Lite (Hardware ID and Registration Key) – Download
Saving raw data (trackstring) as a text file
Available in version 16.2211.10.2
.NET parser SDK can save the parsed trackstrings as a file with the raw extension in the encrypted form. To save the trackstring after parsing you set the value of the RawDataSaveType of the DriverLicense class to the value needed.
public enum SaveType
{
Nothing, //Do not save (Default value)
All, //Save all
OnlyNotParsed //Save if the trackstring is not parsed
}
In the RawDataPath of the DriverLicense class, you can specify the path to the folder where the trackstrings are to be saved. If it is not set, then the trackstrings will be saved in the root folder of the application using the .NET parser SDK.
Files will be saved in the following ways:
Parsed trackstring
FolderWithRawData\yyyy-MM-dd\yyyy-mm-dd_HHmmssfff.raw
Trackstring which is not parsed
FolderWithRawData\yyyy-MM-dd\Unrecognized\yyyy-mm-dd_HHmmssfff.raw
The results of the last save can be found in the LastSaveRawDataResult of the DriverLicense Сlass. LastSaveRawDataResult is an instance of the SaveResult Сlass.
SaveResult Сlass properties
//Save data (a file is saved=true, a file is not saved=false)
public bool Success;
//Message (if the file is not saved the message is shown)
public string Message;
//Complete path to the saved file
public string FilePath;
If RawDataSaveType.RawDataSaveType is not set or equal to SaveType.Nothing, then Success will be false and Message and FilePath will be empty.
using Nautilus;
using System.IO;
...
string TrackString = File.ReadAllText("C:\\FileWithTrackstring.txt");
DriverLicense.RawDataSaveType = SaveType.All;
DriverLicense.RawDataPath = "C:\\Projects\\Trackstrings";
DriverLicense parserResult = DriverLicense.ParseText(TrackString);
string SaveResult = $"{DriverLicense.LastSaveRawDataResult.Success} {DriverLicense.LastSaveRawDataResult.Message} {DriverLicense.LastSaveRawDataResult.FilePath}";
.NET Library Properties, Methods, Events
DriverLicense Class
Object that enables access to parsed information from an ID.
Constructors
Name | Description |
---|---|
DriverLicense() | Initializes an instance of the DriverLicense class |
Fields
Field Name | Type | Description |
---|---|---|
Address1 | string | First line of address of the cardholder |
Address2 | string | Second line of address of the cardholder |
Birthdate | string | Birth date of the cardholder |
CardRevisionDate | string | DHS required field that indicates date of the most recent version change or modification to the visible format of the DL/ID (MMDDCCYY for U.S., CCYYMMDD for Canada) |
City | string | City of the cardholder address |
ClassificationCode | string | Driver License classification code as defined by Federal Highway regulations and by AAMVA; others are defined by DL Classification Code Standards |
ComplianceType | string | DHS required field that indicates compliance:“M” = materially compliant; “F” = fully compliant; and, “N” = non-compliant. |
ComputerID | string | Hardware ID |
Country | string | Country of the cardholder |
CountryCode | string | Three-letter country code |
DiscretionaryIdNumber | string | Discretionary data for use by each jurisdiction |
DocumentType | string | Can be a driver’s license or ID ID – Identity Card DL – Driver License CC – Bank Card HC – Health Card TD – Machine Readable Travel Document CAC – Department of Defense and Common Access Card |
Document Discriminator | string | Number must uniquely identify a particular document issued to that customer from others that may have been issued in the past. This number may serve multiple purposes of document discrimination, audit information number, and/or inventory control. |
EndorsementCodeDescription | string | Description of Endorsements Code |
EndorsementsCode | string | Any endorsements on a driver's license which authorize the operation of specified types of vehicles or the operation of vehicles carrying specified loads. Endorsements shall be specific to classification of a driver's license. |
ExpirationDate | string | Date on which the driving and identification privileges granted by the document are no longer valid (MMDDCCYY for U.S.) For example 05102025, this means May 10, 2025. |
EyeColor | string | Color of cardholder’s eyes, as defined in ANSI D-20 codes |
FirstName | string | First name of the cardholder |
FullName | string | Full name of the cardholder |
Gender | string | Gender of the cardholder |
HairColor | string | Hair color of the cardholder. Brown, black, blonde, gray, red/auburn, sandy, white |
HAZMATExpDate | string | Date on which the hazardous material endorsement granted by the document is no longer valid. (MMDDCCYY for U.S., CCYYMMDD for Canada) |
Height | string | Height of the cardholder, followed by “in” or “cm” |
IIN | string | Issuer Identification Number – the full 6-digit IIN should be encoded |
InventoryControlNumber | string | A string of letters and/or numbers that is affixed to the raw materials (card stock, laminate, etc.) used in producing driver licenses and ID cards. (DHS recommended field) |
IssueDate | string | Issue date of DL/ID. Returned format: MMddyyyy. For example 05102015, this means May 10, 2015. |
IssuedBy | string | Code of the country or a state where the document was issued |
JurisdictionCode | string | State of the cardholder address |
LastName | string | Last name of the cardholder |
LicenseNumber | string | License number of the cardholder |
LimitedDurationDocument | string | DHS required field that indicates that the cardholder has temporary lawful status = “1” |
MiddleName | string | Middle Name of the cardholder |
NamePrefix | string | NamePrefix of the cardholder |
NameSuffix | string | NameSuffix of the cardholder |
OrganDonor | string | Organ Donor |
PassportSeries | string | First two characters of the passport number |
PersonalNumber | string | Personal number (may be used by the issuing country as it desires) |
PostalCode | string | Postal code of cardholder address, if unknown, zeroes will be used |
Race | string | Race or ethnicity of the cardholder as defined in ANSI D20 |
RealId | string | This document is real ID |
RestrictionCode | string | Jurisdiction-specific codes that represent restrictions to driving privileges (such as airbrakes, automatic transmission, daylight only,etc.) |
RestrictionCodeDescription | string | Description of RestrictionCode |
Specification | string | Standard of the scanned document |
TwoDigitYearMaxForExpirationDate | int | It is needed to convert the year from a two-digit format to a four-digit one (ONLY FOR ExpirationDate). If the two-digit year is less than or equal to this value, then this is the current century, and if it is greater, then the previous one. It should be in the range from 99 to 9999. If it does not fall within this range, then the value is taken from the operating system settings: Clock and Region -> Region -> Additional Settings -> Date and change the limits./td> |
VehicleClassCode | string | Jurisdiction-specific vehicle class / group code, designating the type of vehicle the cardholder has privilege to drive. |
VehicleClassCodeDescription | string | Description of VehicleClassCode |
VehicleRegistrationData | VehicleRegistrationData | Data obtained from the vehicle registration certificate |
Veteran | string | Field that indicates that the cardholder is a veteran |
WeightKG | string | Physical weight or weight range in KG ex. 77 up to 31 32 – 45 46 – 59 |
WeightLBS | string | Physical weight or weight range in pounds ex. 138 up to 70 71 – 100 101 – 130 |
ValidationConfidence. Available only under a special product key | int | Shows the degree of authenticity of the document. 0 - this means that the document is really fake; 100 - this means that there are no claims to the document |
ValidationCodes. Available only under a special product key | List |
Validation error codes list for this document. |
Methods
Name | Description | Return Value |
---|---|---|
ExtractInfo(System.String) | Parses scanned text of ID. | Returns true when the input string can be parsed and false when it cannot be parsed |
ExtractInfo(System.String, [System.String = ""]) | Parses scanned text of ID. The first parameter is a string to parse. The second optional parameter is the folder where the license file is located | Returns true when the input string can be parsed and false when it cannot be parsed |
GetLicenseStatus | Returns the status of the license file being used with this Parsing SDK | A string is returned. A value of 1 is returned for a valid license file, a value of 2 is returned for an evaluation copy of a license and a value of 12 is returned for an expired license file |
Static Methods
Name | Description | Return Value |
---|---|---|
ParseText(System.String) | Parses scanned text of ID. | Returns a DriverLicense object on success and null on error |
ParseText(System.String, [System.String = ""]) | Parses scanned text of ID. The first parameter is a string to parse. The second optional parameter is the folder where the license file is located | Returns a DriverLicense object on success and null on error |
GetDlpLibLicenseStatus | Returns the status of the license | DlplibLicenseStatus class object |
DlplibLicenseStatus class
To create an instance of this class do not use it's constructor method, but instead use the static GetDlpLibLicenseStatus method of the DriversLicense class.
Field Name | Type | Description |
---|---|---|
LicenseStatus | string | License status text value |
ExpirationDate | DateTime | Date when the license expires |
StatusCode | int | License status numeric value |
Licensed | bool | If is true, then there is access to library functions |
DlplibLicensePath | string | License file path |
Features | string | Allowed optional functions list |
FeaturesCode | int | Allowed optional functions code |
DriverLicenseEx Class
This class is similar to DriverLicense but also provides support for data types such as date, boolean, string, etc and does not contain an ExtractInfo() method.
Name | Description |
---|---|
DriverLicenseEx() | Initializes an instance of the DriverLicenseEx class |
Fields are the same as DriverLicense.
Methods
Method Name | Description | Return Value |
---|---|---|
ParseText(System.String) | Parses scanned text of ID. | Returns a DriverLicense object on success and null on error |
ParseText(System.String, [System.String = ""]) | Parses scanned text of ID. The first parameter is a string to parse. The second optional parameter is the folder where the license file is located | Returns a DriverLicense object on success and null on error |
VehicleRegistrationData Class
Property name | Type | Description |
---|---|---|
AddressCity | string | City portion of the owner’s address. |
AddressJurisdictionCode | string | Jurisdiction portion of the owner’s address |
AddressStreet | string | Street portion of the owner’s address |
AddressZipCode | string | The Zip code or Postal code of the vehicle owner’s residence address |
Axles | string | The seat capacity of a commercial vehicle designed for transportation of more than then passengers. The number of common axles of rotation of one or more wheels of a vehicle, whether power design or freely rotating. |
BaseJurisdictionRegisteredWeight | string | The declared base jurisdiction registration weight. |
BodyStyle | string | Vehicle manufacture body style |
BusinessName | string | The name of business that owns the vehicle. |
CarrierName | string | The name of the carrier responsible for safety. This can be an individual, partnership or corporation responsible for the transportation of persons or property. This is the name that is recognized by law. |
CarrierNameRegistrant | string | The name of the first registrant of a vehicle. Registrant’s name may be a combined individual name or the name of a business |
DateJunked | string | Date vehicle reported junked |
DateRecovered | string | Date vehicle reported recovered |
DateStolen | string | Date vehicle reported stolen |
EngineDisplacement | string | Manufacturer’s rated engine displacement |
EngineSize | string | The size of a vehicle’s engine |
FamilyName | string | Family name (commonly called surname or last name) of the owner of the vehicle |
FirstLienHolderID | string | A code that uniquely identifies the first holder of a lien |
FirstLienHolderName | string | Name of the first lien holder of the vehicle |
FirstOwnerIDNumber | string | The unique customer number/ID of the first vehicle owner. |
FirstOwnerLastName | string | Last Name or Surname of the Owner. Hyphenated names acceptable, spaces between names acceptable, but no other use of special symbols |
FirstOwnerLegalStatus | string | The legal status of the first vehicle owner. This is only used when a vehicle has multiple owners. A legal status may be (“AND”, “OR”). |
FirstOwnerMiddleName | string | Middle Name(s) or Initial(s) of the Owner. Hyphenated names acceptable, spaces, between names acceptable, but no other use of special symbols. |
FirstOwnerName | string | First Name or Given Name of the Owner. Hyphenated names acceptable, but no other use of special symbols. |
FirstOwnerTotalName | string | Name of the (or one of the) individual(s) who owns the Vehicle (Lastname Firstname MI Suffix if any.) |
FirstRegistrantBusinessName | string | The business name of the first registrant of a vehicle |
Fuel | string | The type of fuel used by the vehicle. In most cases, the fuel type would be diesel |
FuelType | string | Type of fuel the vehicle utilizes. |
GivenName | string | Given name or names (includes all of what are commonly referred to as first and middle names) of the owner of the vehicle |
GrossVehicleWeight | string | The unladen weight of the vehicle (e.g., the single-unit truck, truck combination) plus the weight of the load being carried at a specific point in time |
GrossVehicleWeightWithMaxLoad | string | The unladen weight of the vehicle (e.g.,single-unit truck, truck combination) plus the weight of the maximum load for which vehicle registration fees have been paid within a particular jurisdiction. |
Horsepower | string | Manufacturer’s rated horsepower |
IFTA_Indicator | string | International fuel tax indicator |
IndividualCarrierAddressCity | string | This is the city for the mailing address of the individual carrier. This information is utilized by the base jurisdiction to send information to the carrier that purchased the IRP credentials. |
IndividualCarrierAddressJurisdictionCode | string | This is the jurisdiction of the residential address of the individual carrier. This information is utilized by the base jurisdiction to send information to the carrier that purchased the IRP credentials. |
InspectionAddress | string | The street name and number, city, state and zip code of the inspection facility. |
InspectionAirPollutionDeviceConditions | string | Identifies whether the pollution control devices meet the minimum inspection criteria. |
InspectionFacilityIdentifier | string | The unique number assigned to an inspection facility |
InspectionFormNumberCurrent | string | A unique number assigned to a current vehicle inspection form for identification purposes. |
InspectionFormNumberPrevious | string | The number of the last inspection form excluding the current inspection. |
InspectionSmogCertificateIindicator | string | An indicator that specifies whether or not the vehicle has a current smog certificate |
InspectionStationNumber | string | Station number performing the inspection |
InspectionStickerNumberCurrent | string | Preprinted unique number on the motor vehicle inspection sticker currently issued to a motor vehicle which has passed inspection |
InspectionStickerNumberPrevious | string | The certification number of the last inspection sticker, excluding the current inspection |
InspectorIdentificationNumber | string | A unique number assigned to each licensed vehicle inspector |
IRPIndicator | string | International registration plan indicator |
JunkedIndicator | string | Vehicle has been junked |
MailingAddress1 | string | Street address line 1. (Mailing) |
MailingAddress2 | string | Street address line 2. (Mailing) |
MailingCity | string | Name of city for mailing address |
MailingJurisdictionCode | string | Jurisdiction code for mailing address. Conforms to Canadian, Mexican and US jurisdictions as appropriate. Codes for provinces (Canada) and states (US and Mexico) |
MajorCode | string | State to provide definition |
MakeYear | string | Vehicle manufacture year |
ManufactureGrossWeight | string | Manufacturer’s gross vehicle weight rating |
MinorCode | string | State to provide definition |
ModelYear | string | The year which is assigned to a vehicle by the manufacturer |
MSRP_FLP | string | Manufacturer’s Suggested Retail Price. No decimal places. Right Justified Zero or space fill. |
NewUsedIndicator | string | This code represents whether the vehicle/vessel is new or used. Note: jurisdictions’ definitions of these classifications may vary a little due to state regulations on demo vehicles, slates between dealers, application of state taxes, etc. N = New, U = Used |
NumberOfAxles | string | Number of axles the vehicle has |
NumberOfCylinders | string | Number of cylinders the vehicle has |
NumberOfDoors | string | Number of doors on the vehicle |
NumberOfSeats | string | The seat capacity of a commercial vehicle designed for transportation of more than then passengers. The number of common axles of rotation of one or more wheels of a vehicle, whether power design or freely rotating |
OdometerDate | string | The date the odometer reading was recorded by the jurisdiction. |
OdometerDisclosure | string | This is the federal odometer mileage disclosure. The mandatory information is: (1) Actual vehicle mileage; (2) Mileage exceeds mechanical limitations; (3) Not actual mileage; (4) Mileage disclosure not required. |
OdometerReadingAtInspection | string | The vehicle’s odometer reading (to the nearest mile or kilometer) at the time of inspection |
OdometerReadingKilometers | string | This is the odometer reading registered with the DMV either at the time of titling or registration renewal in kilometers. |
OdometerReadingMileage | string | This is the odometer reading registered with the DMV either at the time of titling or registration renewal |
PreviousTitleNumber | string | The title number assigned to the vehicle by the previous titling jurisdiction |
PreviousTitlingJurisdiction | string | The code for the jurisdiction (U.S.,Canadian, or Mexican) that titled the vehicle immediately prior to the current titling jurisdiction. |
RegistrantFamilyName | string | Family name (commonly called surname or last name) of the registered owner of a vehicle |
RegistrantGivenName | string | Given name or names (includes all of what are commonly referred to as first and middle names) of the registered owner of a vehicle |
RegistrantsResidenceCity | string | City portion of the owner’s address |
RegistrantsResidenceJurisdiction | string | The state or province of the registrant’s residence address |
RegistrantsResidenceStreet | string | The first line of the registrant’s residence address |
RegistrantsResidenceZipCode | string | The ZIP or Postal code of the resident address of the registrant |
RegistrationDecalNumber | string | The number assigned to the registration decal in those jurisdictions that issue decals |
RegistrationEnforcementDate | string | The registration enforcement date is the date that the current registration was enforced. This may or may not be the original registration date |
RegistrationExpirationDate | string | The date in which the registration expired |
RegistrationExpiryDate | string | The date in which the registration expired |
RegistrationIssueDate | string | The date in which the registration was issued |
RegistrationPlateNumber | string | The characters assigned to a registration plate or tag affixed to the vehicle, assigned by the jurisdiction |
RegistrationWindowStickerDecal | string | A unique number printed on the tab/decal and stored as part of the registration record |
RegistrationYear | string | The year of registration |
ResidenceAddress1 | string | Street address line 1. (Mailing) |
ResidenceAddress2 | string | Street address line 2. (Mailing) |
ResidenceCity | string | Name of city for mailing address |
ResidenceJurisdictionCode | string | Jurisdiction code for mailing address. Conforms to Canadian, Mexican and US jurisdictions as appropriate. Codes for provinces (Canada) and states (US and Mexico) |
ResidenceZipCode | string | The ZIP code or Postal code used for mailing. (As used by Canadian, Mexican and US jurisdictions) |
SecondOwnerLastName | string | Last Name or Surname of the Owner. Hyphenated names acceptable, spaces between names acceptable, but no other use of special symbols |
SecondOwnerLegalStatus | string | The legal status of the second vehicle owner. This is only used when a vehicle has multiple owners. A legal status may be (“AND”, “OR”) |
SecondOwnerMiddleName | string | Middle Name(s) or Initial(s) of the Owner. Hyphenated names acceptable, spaces between names acceptable, but no other use of special symbols |
SecondOwnerName | string | First Name or Given Name of the Owner. Hyphenated names acceptable, but no other use of special symbols |
SecondOwnerTotalName | string | Name of the (or one of the) individual(s) who owns the Vehicle (Lastname Firstname MI Suffix if any.) |
StolenIndicator | string | Indicates stolen vehicle |
StreetAddress | string | This is the mailing address of the individual carrier. This information is utilized by the base jurisdiction to send information to the carrier that purchased the IRP credentials. |
TitleBrand | string | Code providing information about the brand applied to the title |
TitleIssueDate | string | The date the jurisdiction’s titling authority issued a title to the owner of the vehicle |
TitleNumber | string | A unique set of alphanumeric characters assigned by the titling jurisdiction to the certificate of title of a vehicle |
Titlingjurisdiction | string | The code for the jurisdiction (U.S.,Canadian, or Mexican) that titled the vehicle |
TransmissionCode | string | Type of transmission the vehicle carries |
TypeOfVehicle | string | The type of vehicle operated for the transportation of persons or property in the furtherance of any commercial or industrial enterprise, for hire or not for hire. Not all states will use all values |
UnitNumber | string | A number, assigned by the registrant of the commercial vehicle or trailer, to identify the vehicle or trailer in the fleet. No two units in a fleet can have the same number. A.K.A vehicle unit number or owner’s equipment number |
UnladenWeight | string | Gross weight of the vehicle unloaded |
USDOTNumber | string | A unique identifier assigned to the carrier responsible for safety issued by the U.S. Department of Transportation – Federal Motor Carrier Safety Administration. |
VehicleBodyStyle | string | The general configuration or shape of a vehicle distinguished by characteristics such as number of doors, seats, windows, roofline, and type of top. The vehicle body type is 2-character alphanumeric |
VehicleBodyType | string | The general configuration or shape of a vehicle distinguished by characteristics such as number of doors, seats, windows, roofline, and type of top. The vehicle body type is 2-character alphanumeric |
VehicleColor | string | Where the vehicle/vessel is one color, this is the appropriate code describing that color. When the vehicle is two colors, this is the code for the top-most or front-most color |
VehicleIdentificationNumber_VIN | string | A unique combination of alphanumeric characters that identifies a specific vehicle or component. The VIN is affixed to the vehicle in specific locations and formulated by the manufacturer. State agencies under some controlled instances my assign a VIN to a vehicle |
VehicleIDNumber | string | Unique number to identify the vehicle record |
VehicleMake | string | The distinctive (coded) name applied to a group of vehicles by a manufacturer |
VehicleModel | string | A code denoting a family of vehicles (within a make), which has a degree of similarity in construction, such as body, chassis, etc. The field does not necessarily contain a standard code; it may contain a value provided by the originator of the field |
VehicleModelYear | string | The year which is assigned to a vehicle by the manufacturer |
VehiclePurchaseDate | string | The date a vehicle was purchased by the current owner |
VehicleStatusCode | string | This is the status of the vehicle (e.g., active, suspend, etc.) |
VehicleTypeCode | string | EPA vehicle classification. |
VehicleUse | string | Indicates the use of the vehicle |
VLT_ClacFromDate | string | Vehicle license tax calculation from date of purchase |
Zip | string | The ZIP or Postal code of the resident address of the vehicle owner |
Validtion IDScan.net's ID Parsing SDK can also validate the document. It requires a special product key.