生成二唯码

Posted 黄者之风

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了生成二唯码相关的知识,希望对你有一定的参考价值。

利用QrCode.Net生成二唯码,需要将QrCode.Net dll下载下来

QrEncoder qrEncoder = new QrEncoder(ErrorCorrectionLevel.H);
QrCode qrCode = new QrCode();
qrEncoder.TryEncode("http://www.xxx.com", out qrCode);
int ModuleSize = 6;
QuietZoneModules QuietZone = QuietZoneModules.Two;
var render = new GraphicsRenderer(new FixedModuleSize(ModuleSize, QuietZone));
using (Stream stream = File.OpenWrite("d:/1.png"))
{
    render.WriteToStream(qrCode.Matrix,ImageFormat.Png,stream);
}
Console.WriteLine("生成成功");
Console.ReadKey();

 

以上是关于生成二唯码的主要内容,如果未能解决你的问题,请参考以下文章