public void url_should_build_https() { var url = "https://code-bude.net"; var generator = new PayloadGenerator.Url(url); generator.ToString().ShouldBe("https://code-bude.net"); }
// ---------------------------------------------------------------- public void GenerateQR(string url) { QRCoder.PayloadGenerator.Url generator = new QRCoder.PayloadGenerator.Url(url); string payload = generator.ToString(); QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode(payload, QRCodeGenerator.ECCLevel.Q); UnityQRCode qrCode = new UnityQRCode(qrCodeData); Texture2D qrCodeAsTexture2D = qrCode.GetGraphic(20); rawImageQR.texture = qrCodeAsTexture2D; rawImageQR.DOFade(1, 0.3f); }
public QRLinkWindow(PedroFileDownload fileData) { InitializeComponent(); //PayloadGenerator.Url url2 = new PayloadGenerator.Url("www.google.es"); PayloadGenerator.Url url = new PayloadGenerator.Url(fileData.Url + @"/index.html"); //PayloadGenerator.WiFi wifiPayload = new PayloadGenerator.WiFi("MyWiFi-SSID", "MyWiFi-Pass", PayloadGenerator.WiFi.Authentication.WPA); QRCodeGenerator.ECCLevel eccLevel= QRCodeGenerator.ECCLevel.L; QRCodeGenerator qrGenerator = new QRCodeGenerator(); //QRCodeData qrCodeData = qrGenerator.CreateQrCode(@fileData.Url+@"\index.html", eccLevel); QRCodeData qrCodeData = qrGenerator.CreateQrCode(url.ToString(), eccLevel); QRCode qrCode = new QRCode(qrCodeData); Bitmap qrCodeBitmap = qrCode.GetGraphic(20, "#000000", "#ffffff"); ImageSource qrImageSource =ConvertBitmapToBitmapImage(qrCodeBitmap); imgQrCode.Source = qrImageSource; }