使用QRCode生成二维码
//自动生成二维码
//link是需要生成二维码的链接
private Bitmap GetQRCode(string link)
{
Bitmap QRCode=null;
try
{
QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();
qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE;
qrCodeEncoder.QRCodeScale = 3;
qrCodeEncoder.QRCodeVersion = 7;
qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M;
QRCode = qrCodeEncoder.Encode(link);
}
catch(Exception ex)
{
throw ex;
}
return QRCode;
}