QR code generation

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.