C# 二维码在线生成
2021-06-12 09:04
标签:module ror sre content util public abi tst evel C# 二维码在线生成 标签:module ror sre content util public abi tst evel 原文地址:https://www.cnblogs.com/AlexLeeLi/p/10510488.html void CreateUrlQRCodeIMG()
{
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetMaxAge(TimeSpan.FromSeconds(600000));
Response.ContentType = "image/gif";
string link = Request.QueryString["url"] ?? string.Empty;
if (string.IsNullOrEmpty(link))
{
return;
}
link = HttpUtility.UrlDecode(link);
QrEncoder qrEncoder = new QrEncoder(ErrorCorrectionLevel.H);
QrCode qrCode = qrEncoder.Encode(link);
GraphicsRenderer renderer = new GraphicsRenderer(new FixedModuleSize(8, QuietZoneModules.Four), Brushes.Black, Brushes.White);
renderer.WriteToStream(qrCode.Matrix, ImageFormat.Gif, Response.OutputStream);
}
下一篇:11.c#类的成员初始化顺序