{"id":657,"date":"2012-11-27T16:23:28","date_gmt":"2012-11-27T16:23:28","guid":{"rendered":"http:\/\/www.bardecode.com\/newsite\/?p=657"},"modified":"2013-02-19T10:58:22","modified_gmt":"2013-02-19T10:58:22","slug":"reading-barcodes-in-vbnet","status":"publish","type":"post","link":"https:\/\/www.bardecode.com\/newsite\/reading-barcodes-in-vbnet\/","title":{"rendered":"Reading Barcodes in VB.Net"},"content":{"rendered":"<p>Using the Softek Barcode Reader SDK to read barcodes from images in a VB.Net project is very straight foward and this article should get you up and running in under 15 minutes&#8230;<\/p>\n<h1><\/h1>\n<h1>Step 1.<\/h1>\n<p>Download the barcode reader sdk from\u00a0<a href=\"http:\/\/www.bardecode.com\/barcoder.exe\">here<\/a><\/p>\n<p>If you are using a 64-bit system and want to handle PDF documents then please run REGISTER.BAT in the x86 folder before you continue.<\/p>\n<p>&nbsp;<\/p>\n<h1>Step 2.<\/h1>\n<p>Open your VB.Net project in Visual Studio or start a Windows Forms Application if you are starting from scratch.<\/p>\n<p>&nbsp;<\/p>\n<h1>Step 3.<\/h1>\n<p>Add a reference to the SoftekBarcodeLib3.dll&#8230;<\/p>\n<p>Select\u00a0<strong>Add Reference<\/strong>\u00a0from the\u00a0<strong>Project<\/strong>\u00a0menu:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/bardecode.com\/images\/vbdotnet1.png\" alt=\"\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Then browse to the installation folder for the Softek Barcode Reader SDK and open the &#8220;anycpu&#8221; folder and select SoftekBarcodeLib3.dll:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/bardecode.com\/images\/vbdotnet2.png\" alt=\"\" border=\"0\" \/><\/p>\n<p>Take a note of the location of the folder where the SDK is installed (<strong>not<\/strong>\u00a0including the anycpu folder)<\/p>\n<p>&nbsp;<\/p>\n<h1>Step 4.<\/h1>\n<p>In the function where you want to read the value of a barcode from an image add the following code:<\/p>\n<pre>        Dim barcode As SoftekBarcodeLib3.BarcodeReader\r\n\r\n        Try\r\n            barcode = New SoftekBarcodeLib3.BarcodeReader(\"\\path\\to\\the\\sdk\\installation\\folder\")\r\n        Catch ex As System.DllNotFoundException\r\n            MessageBox.Show(\"Could not locate the Softek Barcode Reader SDK Installation Folder\")\r\n            Return\r\n        End Try\r\n\r\n        barcode.MultipleRead = True\r\n\r\n        Dim nBarCodes As Integer\r\n\r\n        nBarCodes = barcode.ScanBarCode(\"somefile.tif\")\r\n\r\n        Dim i As Integer\r\n\r\n        For i = 1 To nBarCodes\r\n            MessageBox.Show(\"Found barcode with value \" &amp; barcode.GetBarString(i))\r\n        Next<\/pre>\n<p>&nbsp;<\/p>\n<h1>Step 5.<\/h1>\n<p>That&#8217;s it &#8211; all done. But don&#8217;t forget that there is a lot more to the sdk than just this. If you have any questions then please contact\u00a0<a href=\"mailto:support@bardecode.com\">support@bardecode.com<\/a>\u00a0. Don&#8217;t forget we have lots of sample images under the toolkit installation folder and it&#8217;s always a good idea to try these first before your own images.<\/p>\n<p>You also might wish to add some extra lines of code to turn on or off various barcode types and maybe set a license key:<\/p>\n<p>barcode.ReadQRCode = True<\/p>\n<p>barcode.LicenseKey = &#8220;MY LICENSE KEY&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using the Softek Barcode Reader SDK to read barcodes from images in a VB.Net project is very straight foward and this article should get you up and running in under 15 minutes&#8230; Step 1. Download the barcode reader sdk from\u00a0here If you are using a 64-bit system and want to handle PDF documents then please &hellip; <\/p>\n","protected":false},"author":1,"featured_media":318,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[61,19,184,179,186,185,131,65,183,88,57],"class_list":["post-657","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development-kits","tag-net","tag-barcode","tag-develop","tag-download","tag-integrate","tag-programme","tag-reader","tag-sdk-2","tag-trial","tag-vb-net","tag-visual-basic"],"_links":{"self":[{"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/posts\/657"}],"collection":[{"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/comments?post=657"}],"version-history":[{"count":5,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/posts\/657\/revisions"}],"predecessor-version":[{"id":1545,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/posts\/657\/revisions\/1545"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/media\/318"}],"wp:attachment":[{"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/media?parent=657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/categories?post=657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/tags?post=657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}