Facebook
From Pras, 2 Months ago, written in C#.
Embed
Download Paste or View Raw
Hits: 48
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. using System.Drawing;
  8. using QRCoder;
  9.  
  10.  
  11. namespace Chapter3._1
  12. {
  13.     class QRManager
  14.     {
  15.         public static void TukarInfo(ref TextBox textBox1, ref TextBox textBox2)
  16.         {
  17.             string temp = textBox1.Text;
  18.             textBox1.Text = textBox2.Text;
  19.             textBox2.Text = temp;
  20.         }
  21.         public static string GenerateInfo(string namaAsal, string alamatAsal, string NoHpAsal, string namaTujuan, string alamatTujuan, string NoHpTujuan)
  22.         {
  23.             string result = "#" + namaAsal + "*" + alamatAsal + "*" + NoHpAsal + "*" + namaTujuan + "*" + alamatTujuan + "*" + NoHpTujuan;
  24.             return result;
  25.         }
  26.         public static string GenerateInfo(string namaAsal, string alamatAsal, string NoHpAsal, string namaTujuan, string alamatTujuan, string NoHpTujuan, out Bitmap QrBitmap)
  27.         {
  28.             string text = GenerateInfo(namaAsal, alamatAsal, NoHpAsal, namaTujuan, alamatTujuan, NoHpTujuan);
  29.  
  30.             QRCodeGenerator qrGenerator = new QRCodeGenerator();
  31.             QRCodeData qrCodeData = qrGenerator.CreateQrCode(text, QRCodeGenerator.ECCLevel.Q);
  32.             QRCode qrCode = new QRCode(qrCodeData);
  33.             QrBitmap = qrCode.GetGraphic(20);
  34.  
  35.             return text;
  36.         }
  37.     }
  38. }
  39.