Scan the code locally for test and scan
First, you must have a local network.
Run the "cmd" command:
Enter "ipconfig ":
Get your own IP Address
Configure the project to be tested in iis
Index. aspx is the homepage, that is, the QR code page.
Generate a QR code (index. aspx. cs page, generated based on QRCoder ):
If (! IsPostBack) {QRCodeGenerator generator = new QRCodeGenerator (); QRCodeData data = generator. createQrCode ("http: // 192.168.100.57/test/test.html", QRCodeGenerator. ECCLevel. q); QRCode code = new QRCode (data); Bitmap img = code. getGraphic (30); string imgDir = Server. mapPath ("/Upload/"), imgPath = imgDir + "a.jpg"; if (! Directory. Exists (imgDir) {Directory. CreateDirectory (imgDir);} img. Save (imgPath); Image1.ImageUrl = "/Upload/a.jpg ";}
The generated QR code is automatically scanned and displayed on the page to be tested.