新建Windows应用程序,加入引用ThoughtWorks.QRCode.dll,编写代码生成二维码。

using System;
using System.Drawing;
using System.Windows.Forms;
using ThoughtWorks.QRCode.Codec; namespace QcCodeCreaterExp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Image image;
try
{
QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();
qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE;
qrCodeEncoder.QRCodeScale = Convert.ToInt32(TextBox_QrCodeSize.Text);//尺寸
qrCodeEncoder.QRCodeVersion = Convert.ToInt32(TextBox_QrCodeVersion.Text);//版本号
qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M;
image = qrCodeEncoder.Encode(TextBox_QrCodeContent.Text);
}
catch (Exception ex)
{
image = null;
}
if (image != null)
{
pictureBox1.Image = image;
}
}
}
}

以我博客地址为内容生成二维码,以下是执行效果图。



快拿手机来扫一扫吧。

最新文章

  1. taskkill批量删除进程命令
  2. (Python )运算符
  3. spring 定时任务标注
  4. Hadoop 重启各个节点
  5. cocos中使用VS自动创建工程的方法
  6. 谈谈MVVM和链式网络请求架构
  7. jquery validate 配合ligerui使用
  8. china-pub
  9. EasyUI - Messager消息框
  10. acdream 1222 Quantization Problem [dp]
  11. hdu1255(线段树——矩形面积交)
  12. Gs_Class._BaseQueryWeb查询页面基类(aspx.net)
  13. 第六十七节,html表单元素
  14. 网页版Rstudio︱RStudio Server多人在线协作开发
  15. [WinForm]最小化到系统托盘,右键退出
  16. 斜率优化dp 的简单入门
  17. OpenGL矩阵变换,坐标空间变换
  18. iOS-iOS9系统SEGV_ACCERR问题处理【v3.6.3的一些bug修复】
  19. npm 报错unable to verify the first certificate
  20. OGG_Oracle GoldenGate简介(概念)

热门文章

  1. 手把手教你如何新建scrapy爬虫框架的第一个项目(上)
  2. grant 命令
  3. python 之 MRO 异常
  4. centos7 jumpserver 部署和使用手册(二)
  5. c++ 子类构造函数初始化及父类构造初始化
  6. python基础6(函数 Ⅰ)
  7. HNU 13101 The Triangle Division of the Convex Polygon 组合数的因式分解求法
  8. solr + eclipse 调试环境搭建
  9. Qt之QTemporaryFile
  10. less03 混合