1、下载ThoughtWorks.QRCode.dll
zxing.dll 添加引用命名空间
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ThoughtWorks.QRCode.Codec;
using ZXing;
namespace WindowsForm
{
public partial class WeChatCode : Form
{
public WeChatCode()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if(string.IsNullOrEmpty(textBox1.Text))
{
MessageBox.Show("请输入要生成的二维码!");
return;
}
GetGenerationCode(textBox1.Text);
}
/// <summary>
/// 生成二维码
/// </summary>
/// <param name="msg">二维码信息</param>
/// <returns>图片</retu