Spire.Barcode is a professional barcode library specially designed for .NET developers (C#, VB.NET, ASP.NET, .NET Core) and Java developers (J2SE and J2EE) to generate, read and scan 1D & 2D barcodes.

Wed Oct 29, 2014 2:46 pm

Hello sir,

I have barcode scanned and after that generate xml file.

Please given demo as well as fast.

Thanks & Regards
Jaydeep

jaydeep
 
Posts: 1
Joined: Tue Oct 28, 2014 11:10 am

Thu Oct 30, 2014 3:19 am

Dear jaydeep,

Thanks for your inquiry.

For your requirement, please refer to the code below:
Code: Select all
DataSet ds = new DataSet("BarcodeDataSet");
DataTable dt = new DataTable("BarcodeDataTable");
ds.Tables.Add(dt);
DataColumn dc = new DataColumn("BarcodeImage", typeof(byte[]));
dt.Columns.Add(dc);
DataRow dr = dt.NewRow();
byte[] array;
using (MemoryStream ms = new MemoryStream())
{
    this.barCodeControl1.SaveToStream(ms, ImageFormat.Png);
    array = ms.ToArray();
}
dr["BarcodeImage"] = array;
dt.Rows.Add(dr);
File.WriteAllText("result.xml", ds.GetXml());
System.Diagnostics.Process.Start("result.xml");

Best Regards,
Burning
E-iceblue Support Team
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Return to Spire.BarCode