C# Basit Barkod Okuma Programı etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
C# Basit Barkod Okuma Programı etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

C# Basit Barcode okuma Programı

Merhaba Arkadaşlar ,

Bu bölümde basit şekilde bir barcode okuma programı yazıyor olacağız.projeyi indire bilmeniz ve kaynak kodlarına erişebilmeniz için aşağıdaki linklere tıklayarak projede kullanılan ddl dosyası ve fontları ayrıca proje source tarafını elde edebilirsiniz.Bu aşamada son olarak açacağınız proje üzerine gelip properties diyerek den  freamwork 4 e çekmeniz ve indirmiş olduğunuz font ve dll li proje referans edip eklemniz yeterli olacaktır.



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
namespace BarcodeSamples
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void btnCreateCode_Click(object sender, EventArgs e)
        {
            BarcodeLib.Barcode b = new BarcodeLib.Barcode();
 
            int genislik = Convert.ToInt32(txtWidth.Text);
            int yukseklik = Convert.ToInt32(txtHeight.Text);
            b.Alignment = BarcodeLib.AlignmentPositions.CENTER;
 
            BarcodeLib.TYPE type = BarcodeLib.TYPE.UNSPECIFIED;
            switch (cmbBarcodeTypes.SelectedItem.ToString())
            {
                case "UPC-A":
                    type = BarcodeLib.TYPE.UPCA;
                    break;
 
                case "UPC-E":
                    type = BarcodeLib.TYPE.UPCE;
                    break;
 
                case "UPC 2 Digit Ext.":
                    type = BarcodeLib.TYPE.UPC_SUPPLEMENTAL_2DIGIT;
 
                    break;
                case "UPC 5 Digit Ext.":
                    type = BarcodeLib.TYPE.UPC_SUPPLEMENTAL_5DIGIT;
 
                    break;
                case "EAN-13":
                    type = BarcodeLib.TYPE.EAN13;
 
                    break;
                case "JAN-13":
                    type = BarcodeLib.TYPE.JAN13;
 
                    break;
                case "EAN-8":
                    type = BarcodeLib.TYPE.EAN8;
 
                    break;
                case "ITF-14":
                    type = BarcodeLib.TYPE.ITF14;
 
                    break;
                case "Codabar":
                    type = BarcodeLib.TYPE.Codabar;
 
                    break;
                case "PostNet":
                    type = BarcodeLib.TYPE.PostNet;
 
                    break;
                case "Bookland/ISBN":
                    type = BarcodeLib.TYPE.BOOKLAND;
 
                    break;
                case "Code 11":
                    type = BarcodeLib.TYPE.CODE11;
 
                    break;
                case "Code 39":
                    type = BarcodeLib.TYPE.CODE39;
 
                    break;
                case "Code 39 Extended":
                    type = BarcodeLib.TYPE.CODE39Extended;
 
                    break;
                case "Code 93":
                    type = BarcodeLib.TYPE.CODE93;
 
                    break;
                case "LOGMARS":
                    type = BarcodeLib.TYPE.LOGMARS;
 
                    break;
                case "MSI":
                    type = BarcodeLib.TYPE.MSI_Mod10;
 
                    break;
                case "Interleaved 2 of 5":
                    type = BarcodeLib.TYPE.Interleaved2of5;
 
                    break;
                case "Standard 2 of 5":
                    type = BarcodeLib.TYPE.Standard2of5;
 
                    break;
                case "Code 128":
                    type = BarcodeLib.TYPE.CODE128;
 
                    break;
                case "Code 128-A":
                    type = BarcodeLib.TYPE.CODE128A;
 
                    break;
                case "Code 128-B":
                    type = BarcodeLib.TYPE.CODE128B;
 
                    break;
                case "Code 128-C":
                    type = BarcodeLib.TYPE.CODE128C;
 
                    break;
                case "Telepen":
                    type = BarcodeLib.TYPE.TELEPEN;
 
                    break;
                case "FIM":
                    type = BarcodeLib.TYPE.FIM;
 
                    break;
                default:
                    MessageBox.Show("Barkod türü belirtin !");
                    break;
            }
            try
            {
                if (type != BarcodeLib.TYPE.UNSPECIFIED)
                {
                    pcBarcode.Image = b.Encode(type, txtInsertCode.Text, genislik, yukseklik);
                }
 
                pcBarcode.Width = pcBarcode.Image.Width;
                pcBarcode.Height = pcBarcode.Image.Height;
 
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}

Proje Dosyası indir
Dll indir
Font indir