ConnectCode .Net DLL Integration

ConnectCode Barcode Fonts package includes a .Net 2.0/4.0 Dynamic Link Library (DLL) that you can bundle with your .Net application. This DLL helps you translate input data to barcode output characters, generate check digit and ensure that the data complies with industry specifications. The DLL can be redistributed with a Distribution or Unlimited Distribution License from ConnectCode.

The Resource\Net DLL Integration Samples directory of the installation package includes the .Net DLL and samples that demonstrate the use of the DLL.

Strong-Name .Net Barcode Dynamic Link Library (DLL)

ConnectCode Barcode Fonts package also provides a Strong-Name DLL signed using a cryptographic key pair. This allows the barcode DLL to be deployed to the Global Assembly Cache and you can enjoy all the benefits of a strong name DLL.

Location of the Strong-Name Barcode DLL

The Strong-Name DLL is stored in a subdirectory of the ConnectCode Barcode Fonts package.

       ...\Resource\Net DLL Integration Samples\DLL\StrongName

Integration Topics

Tutorial on using the .Net DLL

In this tutorial, we are going to create a Windows Forms Application that contains a TextBox that uses ConnectCode Barcode Fonts. The application will use the .Net DLL to verify the input and generate a check digit. The application will then set the appropriate fonts to generate the final barcode.

1. Launch Visual Studio (VS2005-2019) to create a new project.

2. Goto File->New->Project. Select Visual C#->Windows Application. You can also choose to create a Visual Basic or Visual C++ application. The ConnectCodeBarcodeFonts.dll is .Net 2.0 (and onwards) compliant and can be used in any of the .Net languages project.

Name the project MyWindowsApplication.

3. Next, add a reference to the ConnectCode Barcode Fonts Library. The ConnectCodeBarcodeFonts.dll library can be found in the Resource\Net DLL Intergration Samples\DLL directory. This can be achieved by right clicking the References object in the Solution Explorer and selecting Add Reference.

4. The Add Reference Dialog will appear as below. Click on the Browse tab and navigate to the Resource\Net DLL Intergration Samples\DLL directory. Select ConnectCodeBarcodeFonts.dll and click ok.

5. The DLL is now ready to be used by the application. We will first add the namespace to the Form1.cs class. This can be carried out by right clicking on the Form1.cs class and selecting View Code. At the top of the Form1.cs class, you will see many "using System..." statements.

Add the statement

"using Net.ConnectCode.Barcode;"

In Visual Basic, you can add

"Imports Net.ConnectCode.Barcode"

6. We will next add the TextBox object to our application. Double click on Form1.cs in the Solution Explorer. Notice that Form1.cs [Design] tab will appear.

Click on the menu item View->Toolbox. In the Common Controls of the Toolbox, select the TextBox object. Next goto Form1 and drop the TextBox object.

Right click on TextBox and click on Properties. Set the Multiline property to True. Change the name of the TextBox to "textBoxOutput".

Next drop a button onto Form1. You Form1 should look like the following:

7. We will now make use of the ConnectCodeBarcodeFonts.dll in our application. Double click on the "button1" object in Form1. The following will appear in the source code editor.
private void button1_Click(object sender, EventArgs e)
8. Add the following code below

private void button1_Click(object sender, EventArgs e)
   //Add Code Start	
   BarcodeFonts barcode = new BarcodeFonts();
   barcode.BarcodeType = BarcodeFonts.BarcodeEnum.Code39;
   barcode.Data = "1234567";
   barcode.CheckDigit = BarcodeFonts.YesNoEnum.Yes;
   textBoxOutput.Text = barcode.EncodedData;
   Font fontz = new Font("CCode39_S3_Trial", 24);
   textBoxOutput.Font = fontz;
   //Add Code End

9. Compile and run the application. You should see the following:

Note :

If you are compiling the projects in Vista, you may need to copy them into a folder that does not require elevated privilege for writing into.

Application Samples

The Resource\Net DLL Integration Samples\MyWindowsApplication directory contains the complete C# sample of the above tutorial.

Application Programming Interface

.NET Barcode API