The following figure shows how to generate a QR code (third-party dotnetbarcode Control) (add the donnetbarcode. dll file to the bin folder)
1. You need to set the following parameters (the following upper-case red parameters can be written to the configuration file)
1. Declare the instance variables of the QR code
Dim BC1 as dotnetbarcode = new dotnetbarcode (dotnetbarcode. types. qrcode)
2 declare the string to be converted into a QR code
Dim barcodenumber as string
3. Path for storing the generated QR code declared and assigned values
Dim myfilename as string = "D: \ Documents ents and Settings \ twqian \ Desktop \ 11111.bmp"
4. Declare and assign values to the side length of the image saved by the generated QR code
Dim myfilelength as integer = "1"
5. assign values to the strings to be converted.
Barcodenumber = "zookeeper has been added when zookeeper has been added"
'Barcodenumber = "Spoke-by-spoke"
'Barcodenumber = "12345566"
6. Define the image storage type.
Bc1.savefiletype = dotnetbarcode. savefiletypes. gif
7. The first parameter is the string to be converted, the second parameter is the address for saving the generated image, and the third parameter is the side length of the saved image.
Bc1.qrsave (barcodenumber, myfilename, myfilelength)
Ii. Complete instance code
'Declare the instance variable of the QR code
Dim BC1 as dotnetbarcode = new dotnetbarcode (dotnetbarcode. types. qrcode)
'Declare the string to be converted into a QR code
Dim barcodenumber as string
'Declare and assign values to the path where the generated QR code is stored
Dim myfilename as string = "D: \ Documents ents and Settings \ twqian \ Desktop \ barcodenumber. BMP"
'Declare and assign a value to the side length of the image saved by the generated QR code
Dim myfilelength as integer = "12"
'Assign a value to the string to be converted
Barcodenumber = me. txtbarcodenumber. Text. Trim
'Barcodenumber = "too many attempts have been made before creating"
'Barcodenumber = "Spoke-by-spoke"
'Barcodenumber = "12345566"
'Define the image storage type
Bc1.savefiletype = dotnetbarcode. savefiletypes. gif
'The first parameter is the string to be converted, the second parameter is the address for saving the generated image, and the third parameter is the side length of the saved image.
Bc1.qrsave (barcodenumber, myfilename, myfilelength)
Download the Japanese donnetbarcode. dll file from the Internet, decompile it, change shift-JIS to gb2312, then reproduce the DLL file, and put the generated DLL into the bin folder.