mirror of
https://github.com/2dust/v2rayN.git
synced 2026-09-26 16:38:40 +03:00
15 lines
437 B
C#
15 lines
437 B
C#
using QRCoder;
|
|
|
|
namespace ServiceLib.Common
|
|
{
|
|
public class QRCodeHelper
|
|
{
|
|
public static byte[]? GenQRCode(string? url)
|
|
{
|
|
using QRCodeGenerator qrGenerator = new();
|
|
using QRCodeData qrCodeData = qrGenerator.CreateQrCode(url ?? string.Empty, QRCodeGenerator.ECCLevel.Q);
|
|
using PngByteQRCode qrCode = new(qrCodeData);
|
|
return qrCode.GetGraphic(20);
|
|
}
|
|
}
|
|
} |