Chia sẻ source code đọc mã vạch Barcode Scanner C# miễn phí, download code ứng dụng đọc mã vạch, barcode sử dụng máy đọc mã vạch bằng C# để bạn học hỏi.
HƯỚNG DẪN
Country Code ( mã phân biệt của các nước)
The Country Code is a 2 or 3 digit number, which is used to identify the country that assigned the manufacturer code. All EAN-13 barcodes that begin with “0″ are UPC-A barcodes. The following table contains the Country Codes:
00-13: USA & Canada
|
20-29: In-Store Functions
|
30-37: France
|
40-44: Germany
|
45: Japan (also 49)
|
46: Russian Federation
|
471: Taiwan
|
474: Estonia
|
475: Latvia
|
477: Lithuania
|
479: Sri Lanka
|
480: Philippines
|
482: Ukraine
|
484: Moldova
|
485: Armenia
|
486: Georgia
|
487: Kazakhstan
|
489: Hong Kong
|
49: Japan (JAN-13)
|
50: United Kingdom
|
520: Greece
|
528: Lebanon
|
529: Cyprus
|
531: Macedonia
|
535: Malta
|
539: Ireland
|
54: Belgium & Luxembourg
|
560: Portugal
|
569: Iceland
|
57: Denmark
|
590: Poland
|
594: Romania
|
599: Hungary
|
600 & 601: South Africa
|
609: Mauritius
|
611: Morocco
|
613: Algeria
|
619: Tunisia
|
622: Egypt
|
625: Jordan
|
626: Iran
|
64: Finland
|
690-692: China
|
70: Norway
|
729: Israel
|
73: Sweden
|
740: Guatemala
|
741: El Salvador
|
742: Honduras
|
743: Nicaragua
|
744: Costa Rica
|
746: Dominican Republic
|
750: Mexico
|
759: Venezuela
|
76: Switzerland
|
770: Colombia
|
773: Uruguay
|
775: Peru
|
777: Bolivia
|
779: Argentina
|
780: Chile
|
784: Paraguay
|
785: Peru
|
786: Ecuador
|
789: Brazil
|
80 – 83: Italy
|
84: Spain
|
850: Cuba
|
858: Slovakia
|
859: Czech Republic
|
860: Yugloslavia
|
869: Turkey
|
87: Netherlands
|
880: South Korea
|
885: Thailand
|
888: Singapore
|
890: India
|
893: Vietnam
|
899: Indonesia
|
90 & 91: Austria
|
93: Australia
|
94: New Zealand
|
955: Malaysia
|
977: International Standard Serial Number for Periodicals (ISSN)
|
978: International Standard Book Numbering (ISBN)
|
979: International Standard Music Number (ISMN)
|
980: Refund receipts
|
981 & 982: Common Currency Coupons
|
99: Coupons
|
Hướng dẫn
Step 1:
Download barcode reader dll from here and add the reference to Onbarcode.Barcode.BarcodeScanner to your application.
Step 2:
This BarcodeScanner dll contain so many methods to scan the barcode image and retrive the data present in those images. Write this two methods to scan the barcode images.
1) ReadBarcodeFromFile:
This method is very simple method to scan the barcode image which will take the filenpath as argument where barcode image is present and retrive String[] as data.
private String[] ReadBarcodeFromFile(string _Filepath)
{
String[] barcodes = BarcodeScanner.Scan(_Filepath, BarcodeType.Code39);
return barcodes;
}
2) Read BarcodeFromBitmap:
This one other method is provided by BarcodeScanner dll which will take Bitmap image as input and returns same String[] as output.
private String[] ReadBarcodeFromBitmap(Bitmap _bimapimage)
{
System.Drawing.Bitmap objImage = _bimapimage;
String[] barcodes = BarcodeScanner.Scan(objImage, BarcodeType.Code39);
return barcodes;
}
You can call this method by passing barcode image as bitmap.
Conclusion:
In this way we can scan the barcode images using C#.
THÔNG TIN TÁC GIẢ
Đang được cập nhật...
Nguồn: Sharecode.vn