http://zxingnet.codeplex.com
After obtaining the dynamically linked libraries (dlls), It is time to create the Asp.net Web project. The figure below shows that the example was made using .Net Framework 4.5.1 while the language is C# using the ASP.net MVC Web project template.
Upon creating the project, Go to a the Home View files and open the index.cshtml
Feel free to change the text provided by the template before an initial test of the page. You can test by
pressing the button beside the browser.
The Page should appear with the expected content
Reference the Zxing Dlls
Browse to wherever the dlls are located. Then check if the zxing dlls were successfully referenced.
Add a class for the QR code generator. Name the class
The class was named QRCodeGenerator
Below is the code for that class
-----
----
Next step is to add a controller method that will call the QRCodeGenerator class's method returning the rendered image. The code of the method is seen below. In this example the Home Controller was given the method that returns the html code with the QR image of a given text
---
---
Enter the code for the cshtml. In this example the index under the Home contained the code for the Qr
Generation.
---
In my example the following code were modified after Visual Studio generated the Asp.net MVC C#
project
Look at the results. The solution should be ready to be built and published
After the publishing the page should appear on a browser. Feel free to enter a url on the textbox and
press the Get QR button
No comments:
Post a Comment