C# QRBarCode

1. install-package barcode -v 4.0.2.2;

2.

using IronBarCode; 
 class Program
    {         
        static void Main(string[] args)
        {
            BarCodeDemo();
            Console.ReadLine();
        }

        static void BarCodeDemo()
        {
            string barCodeMsg = "Be bold and make a difference!";
            GeneratedBarcode MyBarCode =BarcodeWriter.CreateBarcode(barCodeMsg, BarcodeWriterEncoding.QRCode);
            string pictureFilePath = DateTime.Now.ToString("yyyyMMddHHmmssFFFF") + ".jpg";
            MyBarCode.SaveAsPng(pictureFilePath);
            System.Diagnostics.Process.Start(pictureFilePath);                       
        }
}

 

posted @ 2019-09-30 16:55  FredGrit  阅读(472)  评论(0编辑  收藏  举报