var barcodeImage = DWObject.GetImageURL(index, -1, -1); dbrObject.readURLAsync(barcodeImage, index, GetBarcodeInfo, OnBarcodeReadFailure); function OnBarcodeReadFailure(sImageIndex, errorCode, errorString) { console.log(errorString); } function GetBarcodeInfo(sImageIndex, result) {//This is the function called when barcode is read successfully //Retrieve barcode details var count = result.getCount(); if (count == 0) { alert("The barcode for the selected format is not found."); return; } else { for (i = 0; i < count; i++) { Barcode_text = result.get(i).text; var x = result.get(i).x1; var y = result.get(i).y1; var format = result.get(i).formatString; var barcodeText = ("barcode[" + (i + 1) + "]: " + "\n" + Barcode_text + "\n"); extractInformation(); } } }
driverLicenseFields = [ { 'abbreviation': 'DAA', 'description': 'Full Name' } , { 'abbreviation': 'DAB', 'description': 'Last Name' } , { 'abbreviation': 'DAB', 'description': 'Family Name' } , { 'abbreviation': 'DAC', 'description': 'First Name' } , { 'abbreviation': 'DAC', 'description': 'Given Name' } , { 'abbreviation': 'DAD', 'description': 'Middle Name or Initial' } , { 'abbreviation': 'DAD', 'description': 'Middle Name' } , { 'abbreviation': 'DAE', 'description': 'Name Suffix' } , { 'abbreviation': 'DAF', 'description': 'Name Prefix' } , { 'abbreviation': 'DAG', 'description': 'Mailing Street Address1' } , { 'abbreviation': 'DAH', 'description': 'Mailing Street Address2' } , { 'abbreviation': 'DAI', 'description': 'Mailing City' } , { 'abbreviation': 'DAJ', 'description': 'Mailing Jurisdiction Code' } , { 'abbreviation': 'DAK', 'description': 'Mailing Postal Code' } , { 'abbreviation': 'DAL', 'description': 'Residence Street Address1' } , { 'abbreviation': 'DAM', 'description': 'Residence Street Address2' } , { 'abbreviation': 'DAN', 'description': 'Residence City' } , { 'abbreviation': 'DAO', 'description': 'Residence Jurisdiction Code' } , { 'abbreviation': 'DAP', 'description': 'Residence Postal Code' } , { 'abbreviation': 'DAQ', 'description': 'License or ID Number' } , { 'abbreviation': 'DAR', 'description': 'License Classification Code' } , { 'abbreviation': 'DAS', 'description': 'License Restriction Code' } , { 'abbreviation': 'DAT', 'description': 'License Endorsements Code' } , { 'abbreviation': 'DAU', 'description': 'Height in FT_IN' } , { 'abbreviation': 'DAV', 'description': 'Height in CM' } , { 'abbreviation': 'DAW', 'description': 'Weight in LBS' } , { 'abbreviation': 'DAX', 'description': 'Weight in KG' } , { 'abbreviation': 'DAY', 'description': 'Eye Color' } , { 'abbreviation': 'DAZ', 'description': 'Hair Color' } , { 'abbreviation': 'DBA', 'description': 'License Expiration Date' } , { 'abbreviation': 'DBB', 'description': 'Date of Birth' } , { 'abbreviation': 'DBC', 'description': 'Sex' } , { 'abbreviation': 'DBD', 'description': 'License or ID Document Issue Date' } , { 'abbreviation': 'DBE', 'description': 'Issue Timestamp' } , { 'abbreviation': 'DBF', 'description': 'Number of Duplicates' } , { 'abbreviation': 'DBG', 'description': 'Medical Indicator Codes' } , { 'abbreviation': 'DBH', 'description': 'Organ Donor' } , { 'abbreviation': 'DBI', 'description': 'Non-Resident Indicator' } , { 'abbreviation': 'DBJ', 'description': 'Unique Customer Identifier' } , { 'abbreviation': 'DBK', 'description': 'Social Security Number' } , { 'abbreviation': 'DBL', 'description': 'Date Of Birth' } , { 'abbreviation': 'DBM', 'description': 'Social Security Number' } , { 'abbreviation': 'DBN', 'description': 'Full Name' } , { 'abbreviation': 'DBO', 'description': 'Last Name' } , { 'abbreviation': 'DBO', 'description': 'Family Name' } , { 'abbreviation': 'DBP', 'description': 'First Name' } , { 'abbreviation': 'DBP', 'description': 'Given Name' } , { 'abbreviation': 'DBQ', 'description': 'Middle Name' } , { 'abbreviation': 'DBQ', 'description': 'Middle Name or Initial' } , { 'abbreviation': 'DBR', 'description': 'Suffix' } , { 'abbreviation': 'DBS', 'description': 'Prefix' } , { 'abbreviation': 'DCA', 'description': 'Virginia Specific Class' } , { 'abbreviation': 'DCB', 'description': 'Virginia Specific Restrictions' } , { 'abbreviation': 'DCD', 'description': 'Virginia Specific Endorsements' } , { 'abbreviation': 'DCE', 'description': 'Physical Description Weight Range' } , { 'abbreviation': 'DCF', 'description': 'Document Discriminator' } , { 'abbreviation': 'DCG', 'description': 'Country territory of issuance' } , { 'abbreviation': 'DCH', 'description': 'Federal Commercial Vehicle Codes' } , { 'abbreviation': 'DCI', 'description': 'Place of birth' } , { 'abbreviation': 'DCJ', 'description': 'Audit information' } , { 'abbreviation': 'DCK', 'description': 'Inventory Control Number' } , { 'abbreviation': 'DCL', 'description': 'Race Ethnicity' } , { 'abbreviation': 'DCM', 'description': 'Standard vehicle classification' } , { 'abbreviation': 'DCN', 'description': 'Standard endorsement code' } , { 'abbreviation': 'DCO', 'description': 'Standard restriction code' } , { 'abbreviation': 'DCP', 'description': 'Jurisdiction specific vehicle classification description' } , { 'abbreviation': 'DCQ', 'description': 'Jurisdiction-specific' } , { 'abbreviation': 'DCR', 'description': 'Jurisdiction specific restriction code description' } , { 'abbreviation': 'DCS', 'description': 'Family Name' } , { 'abbreviation': 'DCS', 'description': 'Last Name' } , { 'abbreviation': 'DCT', 'description': 'Given Name' } , { 'abbreviation': 'DCT', 'description': 'First Name' } , { 'abbreviation': 'DCU', 'description': 'Suffix' } , { 'abbreviation': 'DDA', 'description': 'Compliance Type' } , { 'abbreviation': 'DDB', 'description': 'Card Revision Date' } , { 'abbreviation': 'DDC', 'description': 'HazMat Endorsement Expiry Date' } , { 'abbreviation': 'DDD', 'description': 'Limited Duration Document Indicator' } , { 'abbreviation': 'DDE', 'description': 'Family Name Truncation' } , { 'abbreviation': 'DDF', 'description': 'First Names Truncation' } , { 'abbreviation': 'DDG', 'description': 'Middle Names Truncation' } , { 'abbreviation': 'DDH', 'description': 'Under 18 Until' } , { 'abbreviation': 'DDI', 'description': 'Under 19 Until' } , { 'abbreviation': 'DDJ', 'description': 'Under 21 Until' } , { 'abbreviation': 'DDK', 'description': 'Organ Donor Indicator' } , { 'abbreviation': 'DDL', 'description': 'Veteran Indicator' } , { 'abbreviation': 'PAA', 'description': 'Permit Classification Code' } , { 'abbreviation': 'PAB', 'description': 'Permit Expiration Date' } , { 'abbreviation': 'PAC', 'description': 'Permit Identifier' } , { 'abbreviation': 'PAD', 'description': 'Permit IssueDate' } , { 'abbreviation': 'PAE', 'description': 'Permit Restriction Code' } , { 'abbreviation': 'PAF', 'description': 'Permit Endorsement Code' } , { 'abbreviation': 'ZVA', 'description': 'Court Restriction Code' } ]
From: POSTMASTER@domain.com To: jdoe@domain.com Subject: Message Delivery Failure MailEnable: Message Delivery Failure. The following recipient(s) could not be reached: Recipient: [SMTP: bill@domain.com] Reason: The message could not be delivered because the domain name (domain.com) does not appear to be registered.
From: MAILER-DAEMON@domain.local To: jdoe@localhost Subject: Undeliverable mail: Failed to deliver to ''
// Create POP3 object Pop3 pop = new Pop3(); // Enable logging to file pop.Log.Enabled = true; pop.Log.Filename = @"C:\log.txt"; pop.Log.Clear(); // Connect to POP3 server pop.Connect("mail.domain.com"); pop.Login("bounce", "secret"); // Download headers and bodies of all messages. MailMessageCollection msgs = pop.DownloadMessageHeaders(1, -1, -1); // Loop through all messages in the mailbox foreach (MailMessage msg in msgs) { string strLine = msg.BodyPlainText; Console.WriteLine("From: " + msg.From.Email); // Get failed email address string str_invalid_email = GetInvalidEmailAddressME(msg); // If str_invalid_email is non-empty then failed email // address was found if (str_invalid_email.Length > 0) { // Remove failed email from database RemoveEmailFromDatabase(str_invalid_email); // Display invalid adress Console.WriteLine("Invalid email: " + str_invalid_email); // Delete bounced email from server to avoid // processing it next time pop.DeleteMessage(msg.IndexOnServer); } } // Disconnect from POP3 server pop.Disconnect(); // The function checks whether the message is bounced and extracts // failed address // from bounced message. Valid only for MailEnable servers static string GetInvalidEmailAddressME(MailMessage msg) { string str_invalid_email = msg.BodyPlainText; // Check if this is a bounced message report if (msg.Subject.IndexOf("Delivery Failure") == -1) { return ""; } if (msg.From.ToString().IndexOf("POSTMASTER") == -1) { return ""; } // Now we're sure this is a bounced message report int i_start; i_start = str_invalid_email.IndexOf("SMTP:"); // Check if bounced message report contains "Recipient:" field if (i_start == -1) { return ""; } // Get failed address i_start += 5; i_end = str_invalid_email.IndexOf("]",i_start); str_invalid_email.Substring(i_start, i_end); return str_invalid_email; } // The function checks whether the message is bounced and extracts // failed address // from bounced message. Valid only for Communigate Pro servers static string GetInvalidEmailAddressCP(MailMessage msg) { string str_invalid_email = msg.BodyPlainText; // Check if this is a bounced message report if (msg.Subject.IndexOf("Undeliverable mail") == -1) { return ""; } if (msg.From.ToString().IndexOf("MAILER-DAEMON") == -1) { return ""; } // Now we're sure this is a bounced message report int i_start; i_start = str_invalid_email.IndexOf("to '<"); // Check if bounced message report contains // "Failed to deliver to " field if (i_start == -1) { return ""; } // Get failed address i_start += 5; i_end = str_invalid_email.IndexOf("]",i_start); str_invalid_email.Substring(i_start, i_end); return str_invalid_email; } // This function must remove (or disable) specified // email address from mailing list static void RemoveEmailFromDatabase(string str_invalid_email) { // TODO: Add your code here }
Dim pop As New Pop3 ' Enable logging to file pop.Log.Enabled = True pop.Log.Filename = "C:\log.txt" pop.Log.Clear() ' Connect to POP3 server pop.Connect("mail.domain.com") pop.Login("jdoe", "secret") ' Download headers and bodies for all messages. Dim msgs As MailMessageCollection = pop.DownloadMessageHeaders(1, -1, -1) ' Loop through all messages in the mailbox Dim msg As MailMessage For Each msg In msgs Dim strLine As String = msg.BodyPlainText Console.WriteLine("From: " + msg.From.Email) ' Get failed email address Dim str_invalid_email As String = GetInvalidEmailAddressME(msg) ' If str_invalid_email is non-empty then failed email ' address was found If str_invalid_email.Length > 0 Then 'Remove failed email from database RemoveEmailFromDatabase(str_invalid_email) ' Display invalid address Console.WriteLine("Invalid email: " & str_invalid_email) ' Delete bounced email from server to avoid ' processing it next time pop.DeleteMessage(msg.IndexOnServer) End If Next Console.ReadLine() ' Disconnect from POP3 server pop.Disconnect() ' The function checks whether the message is bounced and extracts ' failed address ' from bounced message. Valid only for MailEnable servers Function GetInvalidEmailAddressME(ByVal msg As MailMessage) As String Dim str_invalid_email As String = msg.BodyPlainText ' Check if this is a bounced message report If msg.Subject.IndexOf("Delivery Failure") = -1 Then Return "" End If If msg.From.ToString().IndexOf("POSTMASTER") = -1 Then Return "" End If ' Now we're sure this is a bounced message report Dim i_start As Integer, i_end As Integer i_start = str_invalid_email.IndexOf("SMTP:") ' Check if bounced message report contains "Recipient:" field If i_start = -1 Then Return "" End If ' Get failed address i_start += 5 i_end = str_invalid_email.IndexOf("]", i_start) str_invalid_email.Substring(i_start, i_end) Return str_invalid_email End Function ' The function checks whether the message is bounced and extracts ' failed address ' from bounced message. Valid only for Communigate Pro servers Function GetInvalidEmailAddressCP(ByVal msg As MailMessage) As String Dim str_invalid_email As String = msg.BodyPlainText ' Check if this is a bounced message report If msg.Subject.IndexOf("Undeliverable mail") = -1 Then Return "" End If If msg.From.ToString().IndexOf("MAILER-DAEMON") = -1 Then Return "" End If ' Now we're sure this is a bounced message report Dim i_start As Integer, i_end As Integer i_start = str_invalid_email.IndexOf("to '<") ' Check if bounced message report contains ' "Failed to deliver to " field If i_start = -1 Then Return "" End If ' Get failed address i_start += 5 i_end = str_invalid_email.IndexOf("]", i_start) str_invalid_email.Substring(i_start, i_end) Return str_invalid_email End Function ' This function must remove (or disable) specified ' email address from mailing list Sub RemoveEmailFromDatabase(ByVal str_invalid_email As String) ' TODO: Add your code here End Sub
2017慧都十四周年狂欢搞事情!砸金蛋100%抽现金红包、满额豪送iPhone X、iPhone 8、DevExpress汉化免费送、团队升级培训套包劲省10万元......更多惊喜等您来探索!
试用、下载、了解更多产品信息请点击"咨询在线客服"
// Set your license
RasterSupport.setLicense(licenseFile, developerKey);
try{
if(RasterSupport.getKernelExpired()) {
System.out.println("License NOT Set Successfully");
}
else {
System.out.println("License Set Successfully");
}
RasterCodecs rasterCodecs = new RasterCodecs();
MRTDReader mrtdReader = new MRTDReader();
String stream = "PASSPORT_IMAGE.jpg";
RasterImage rasterImage = rasterCodecs.load(stream);
OcrEngine ocrEngine = OcrEngineManager.createEngine(OcrEngineType.ADVANTAGE);
ocrEngine.startup(rasterCodecs, null, null, null);
mrtdReader.setOcrEngine(ocrEngine);
mrtdReader.processImage(rasterImage);
mrtdReader.setImproveResults(true);
HashMap ar = new HashMap<>();
ar = mrtdReader.getResults();
String[] string = mrtdReader.getLines();
for (String string2 : string) {
System.out.println(string2);
}
for (Map.Entry map : ar.entrySet()) {
MRTDField key = map.getKey();
System.out.println(key);
MRTDDataElement value = map.getValue();
System.out.println(value.getReadableValue());
}
ocrEngine.shutdown();
}
catch(Exception e)
{
e.printStackTrace();
throw new Exception(e);
}
2017慧都十四周年狂欢搞事情!砸金蛋100%抽现金红包、满额豪送iPhone X、iPhone 8、DevExpress汉化免费送、团队升级培训套包劲省10万元......更多惊喜等您来探索!