This simple problem has plagued me for nearly two hours, mainly because I did not find a demo in the official document. I can only use the search engine to check the programs written by other programmers, however, it was found that there were pitfalls everywhere. I read four or five examples. None of them were able to run normally, and all of them reported errors. After more than an hour of trying, I finally got it done. Let's just move on to the code. The second step is to create An aspx file. The code in the background is as follows: using ZXing. common; using ZXing. rendering; using System. drawing; using System. drawing. imaging; using ZXing. qrCode. internal; namespace zxingtm {public partial class txm: System. web. UI. page {protected void Page_Load (object sender, EventArgs e) {MultiFormatWriter mutiWriter = new MultiFormatWriter (); BitMatrix bm = mutiWriter. encode ("123456789", BarcodeFormat. CODE_39, 363,150); Bitmap img = new BarcodeWriter (). write (bm); img. save ("d:/1.jpeg", System. drawing. imaging. imageFormat. jpeg) ;}} in the Code, "123456789" was written to death during the test, and can be replaced by variables. BarcodeFormat. CODE_39 and other parameters can be replaced with other parameters to generate bar codes of other formats. In this case, 1 is output on disk D. the main functions of jepg barcode image have been implemented here. The generated barcode image is as follows: scan the barcode function of the mobile phone and the result is exactly 123456789.