1.Nuget安装插件包
2.介绍两个包中最简单的使用方法。
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace WpfApp1 { /// <summary> /// MainWindow.xaml 的交互逻辑 /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); //1.生成二维码 QRCoder.QRCodeHelper.GetQRCode("华为mate20", 10, System.Drawing.Color.Black, System.Drawing.Color.White, QRCoder.QRCodeGenerator.ECCLevel.H); //2.生成条形码 IronBarCode.BarcodeWriter.CreateBarcode("mate20", IronBarCode.BarcodeWriterEncoding.Code128). SaveAsJpeg($"{Environment.CurrentDirectory}\\1.jpeg"); } } }