欧美阿v视频在线大全_亚洲欧美中文日韩V在线观看_www性欧美日韩欧美91_亚洲欧美日韩久久精品

主頁 > 知識庫 > 用.NET如何生成二維碼

用.NET如何生成二維碼

熱門標簽:西寧電銷外呼系統公司 云南外呼系統代理 寧德防封版電銷卡 海東防封電銷卡 南昌自動外呼系統線路 安陸市地圖標注app 聊城智能電銷機器人電話 辦公用地圖標注網點怎么操作 上海市三維地圖標注

下面介紹一下如何用.NET生成二維碼(QR Code碼制),下面給出詳細步驟:

1、新建一個window應用程序,然后引入.NET二維碼類庫(開源的類庫,可從網上下載):

2、構建UI界面,代碼如下:

namespace WinQRCode 
{ 
  partial class Form1 
  { 
    /// summary> 
    /// 必需的設計器變量。 
    /// /summary> 
    private System.ComponentModel.IContainer components = null; 
 
    /// summary> 
    /// 清理所有正在使用的資源。 
    /// /summary> 
    /// param name="disposing">如果應釋放托管資源,為 true;否則為 false。/param> 
    protected override void Dispose(bool disposing) 
    { 
      if (disposing  (components != null)) 
      { 
        components.Dispose(); 
      } 
      base.Dispose(disposing); 
    } 
 
    #region Windows 窗體設計器生成的代碼 
 
    /// summary> 
    /// 設計器支持所需的方法 - 不要 
    /// 使用代碼編輯器修改此方法的內容。 
    /// /summary> 
    private void InitializeComponent() 
    { 
      this.button1 = new System.Windows.Forms.Button(); 
      this.button2 = new System.Windows.Forms.Button(); 
      this.pictureBox1 = new System.Windows.Forms.PictureBox(); 
      this.label1 = new System.Windows.Forms.Label(); 
      this.textBox1 = new System.Windows.Forms.TextBox(); 
      this.label2 = new System.Windows.Forms.Label(); 
      this.lbl解碼信息 = new System.Windows.Forms.Label(); 
      ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 
      this.SuspendLayout(); 
      // 
      // button1 
      // 
      this.button1.Location = new System.Drawing.Point(446, 31); 
      this.button1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); 
      this.button1.Name = "button1"; 
      this.button1.Size = new System.Drawing.Size(103, 37); 
      this.button1.TabIndex = 0; 
      this.button1.Text = "編碼"; 
      this.button1.UseVisualStyleBackColor = true; 
      this.button1.Click += new System.EventHandler(this.button1_Click); 
      // 
      // button2 
      // 
      this.button2.Location = new System.Drawing.Point(446, 81); 
      this.button2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); 
      this.button2.Name = "button2"; 
      this.button2.Size = new System.Drawing.Size(103, 37); 
      this.button2.TabIndex = 1; 
      this.button2.Text = "解碼"; 
      this.button2.UseVisualStyleBackColor = true; 
      this.button2.Click += new System.EventHandler(this.button2_Click); 
      // 
      // pictureBox1 
      // 
      this.pictureBox1.Location = new System.Drawing.Point(23, 117); 
      this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); 
      this.pictureBox1.Name = "pictureBox1"; 
      this.pictureBox1.Size = new System.Drawing.Size(279, 253); 
      this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 
      this.pictureBox1.TabIndex = 2; 
      this.pictureBox1.TabStop = false; 
      // 
      // label1 
      // 
      this.label1.AutoSize = true; 
      this.label1.Location = new System.Drawing.Point(18, 39); 
      this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 
      this.label1.Name = "label1"; 
      this.label1.Size = new System.Drawing.Size(69, 25); 
      this.label1.TabIndex = 3; 
      this.label1.Text = "信息:"; 
      // 
      // textBox1 
      // 
      this.textBox1.Location = new System.Drawing.Point(95, 37); 
      this.textBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); 
      this.textBox1.Name = "textBox1"; 
      this.textBox1.Size = new System.Drawing.Size(333, 31); 
      this.textBox1.TabIndex = 4; 
      // 
      // label2 
      // 
      this.label2.AutoSize = true; 
      this.label2.Location = new System.Drawing.Point(18, 81); 
      this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 
      this.label2.Name = "label2"; 
      this.label2.Size = new System.Drawing.Size(88, 25); 
      this.label2.TabIndex = 5; 
      this.label2.Text = "二維碼:"; 
      // 
      // lbl解碼信息 
      // 
      this.lbl解碼信息.AutoSize = true; 
      this.lbl解碼信息.Location = new System.Drawing.Point(101, 81); 
      this.lbl解碼信息.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 
      this.lbl解碼信息.Name = "lbl解碼信息"; 
      this.lbl解碼信息.Size = new System.Drawing.Size(0, 25); 
      this.lbl解碼信息.TabIndex = 6; 
      // 
      // Form1 
      // 
      this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F); 
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 
      this.ClientSize = new System.Drawing.Size(572, 384); 
      this.Controls.Add(this.lbl解碼信息); 
      this.Controls.Add(this.label2); 
      this.Controls.Add(this.textBox1); 
      this.Controls.Add(this.label1); 
      this.Controls.Add(this.pictureBox1); 
      this.Controls.Add(this.button2); 
      this.Controls.Add(this.button1); 
      this.Font = new System.Drawing.Font("微軟雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); 
      this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); 
      this.Name = "Form1"; 
      this.Text = "二維碼"; 
      ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 
      this.ResumeLayout(false); 
      this.PerformLayout(); 
 
    } 
 
    #endregion 
 
    private System.Windows.Forms.Button button1; 
    private System.Windows.Forms.Button button2; 
    private System.Windows.Forms.PictureBox pictureBox1; 
    private System.Windows.Forms.Label label1; 
    private System.Windows.Forms.TextBox textBox1; 
    private System.Windows.Forms.Label label2; 
    private System.Windows.Forms.Label lbl解碼信息; 
  } 
} 

圖形如下所示:

3、編寫 編碼和解碼按鈕事件,進行編碼和解碼處理:

using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Windows.Forms; 
 
namespace WinQRCode 
{ 
  using ThoughtWorks.QRCode.Codec; 
  using ThoughtWorks.QRCode.Codec.Data; 
  using ThoughtWorks.QRCode.Codec.Util; 
  using System.IO; 
  using PdfToImage; 
  public partial class Form1 : Form 
  { 
    public Form1() 
    { 
      InitializeComponent(); 
    } 
    /// summary> 
    /// 編碼 
    /// /summary> 
    /// param name="sender">/param> 
    /// param name="e">/param> 
    private void button1_Click(object sender, EventArgs e) 
    { 
      if (this.textBox1.Text != "") 
      { 
        Cursor.Current = Cursors.WaitCursor; 
        if (textBox1.Text.Trim() == String.Empty) 
        { 
          MessageBox.Show("不能為空."); 
          return; 
        } 
        QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();        
        qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE; 
        qrCodeEncoder.QRCodeScale = 4; 
        qrCodeEncoder.QRCodeVersion = 7;       
        qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M;        
        System.Drawing.Image image; 
        String data = textBox1.Text; 
        //編碼 
        image = qrCodeEncoder.Encode(data); 
        //圖片顯示 
        this.pictureBox1.Image = image; 
        Cursor.Current = Cursors.Default; 
 
      } 
    } 
    /// summary> 
    /// 解碼 
    /// /summary> 
    /// param name="sender">/param> 
    /// param name="e">/param> 
    private void button2_Click(object sender, EventArgs e) 
    { 
      Cursor.Current = Cursors.WaitCursor; 
      Bitmap b = this.pictureBox1.Image as Bitmap; 
      try 
      { 
        QRCodeDecoder decoder = new QRCodeDecoder(); 
        //解碼 
        String decodedString = decoder.decode(new QRCodeBitmapImage(b)); 
        //顯示解碼信息 
        this.lbl解碼信息.Text += decodedString ; 
      } 
      catch (Exception ex) 
      { 
        MessageBox.Show(ex.Message); 
      } 
      Cursor.Current = Cursors.Default; 
    } 
 
    private void Form1_Load(object sender, EventArgs e) 
    { 
 
    } 
  } 
} 

4、編譯運行,如下圖:

以上就是關于使用.NET生成二維碼的大概思路,還有許多不足之處,希望大家多提建議,或者自己進行創新修改。

您可能感興趣的文章:
  • Android上使用ZXing識別條形碼與二維碼的方法
  • APS.NET MVC4生成二維碼簡單解析
  • php二維碼生成
  • IOS筆記061之二維碼的生成和掃描
  • android中圓角圖像生成方法
  • Android調用google地圖生成路線圖實現代碼
  • Android編程實現二維碼的生成與解析

標簽:南寧 洛陽 汕尾 青海 衢州 崇左 贛州 平涼

巨人網絡通訊聲明:本文標題《用.NET如何生成二維碼》,本文關鍵詞  用,.NET,如何,生成,二維,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《用.NET如何生成二維碼》相關的同類信息!
  • 本頁收集關于用.NET如何生成二維碼的相關信息資訊供網民參考!
  • 推薦文章
    欧美阿v视频在线大全_亚洲欧美中文日韩V在线观看_www性欧美日韩欧美91_亚洲欧美日韩久久精品
  • <rt id="w000q"><acronym id="w000q"></acronym></rt>
  • <abbr id="w000q"></abbr>
    <rt id="w000q"></rt>
    欧美激情aaa| 久久久久久毛片| 亚洲视频中文字幕| 国产精品1区二区.| 欧美日韩生活片| 2014亚洲片线观看视频免费| 日韩极品在线观看| 国产精品手机在线观看| 9191精品国产综合久久久久久| 亚洲欧美日韩国产成人精品影院| 成人av动漫网站| 青青草原在线免费观看| 中文字幕一区二区三区四区| 成人黄色大片在线观看| 成人观看免费视频| 亚洲品质自拍视频网站| 91在线视频播放| 欧美性极品少妇| 亚洲成人免费在线| 一本加勒比波多野结衣| 日韩精品一区二区三区在线播放| 青青草97国产精品免费观看 | 国产精品久久久久久久久久久免费看| 国产馆精品极品| 亚洲波多野结衣| 亚洲欧美色图小说| 人妻互换一二三区激情视频| 91精品国产高清一区二区三区蜜臀| 舔着乳尖日韩一区| 色一情一交一乱一区二区三区| 久久久久久夜精品精品免费| 国产精品88av| 在线国产亚洲欧美| 天天射综合影视| 成人无码av片在线观看| 国产精品网站一区| 91麻豆swag| 欧美一区二区观看视频| 国内精品嫩模私拍在线| 色欲人妻综合网| 91精品一区二区三区蜜桃| 亚洲色图欧美在线| 在线看黄色的网站| 久久亚洲精华国产精华液 | 日韩精品一区二区三区蜜臀| 久久国产综合精品| 日日噜噜夜夜狠狠久久波多野| 一区二区三区中文字幕精品精品 | 视频一区国产视频| 免费看91的网站| 中文字幕中文字幕在线一区| 久久久久99人妻一区二区三区| 精品入口麻豆88视频| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 男人的午夜天堂| 一区二区三区日韩| 免费在线观看污| 成人欧美一区二区三区小说| fc2成人免费视频| 国产清纯白嫩初高生在线观看91| 91免费看`日韩一区二区| 日韩精品中文字幕在线不卡尤物| 成人免费看的视频| 欧美一级黄色片| 岛国精品在线观看| 日韩一区二区电影| 成人涩涩免费视频| 日韩免费一区二区| 91在线小视频| 26uuu国产在线精品一区二区| 99综合电影在线视频| 日韩免费福利电影在线观看| www.欧美.com| 精品国产精品一区二区夜夜嗨| 91丨九色丨尤物| 国产亚洲一区二区三区四区| 欧洲成人午夜精品无码区久久| 国产欧美日韩在线视频| 色哟哟视频在线| 国产精品白丝在线| 国产在线综合视频| 亚洲成人第一页| 色婷婷久久99综合精品jk白丝| 麻豆精品在线播放| 欧美色成人综合| 高清在线成人网| 精品久久久久一区| 男人网站在线观看| 亚洲柠檬福利资源导航| 纪美影视在线观看电视版使用方法| 亚洲第一主播视频| 一本大道av一区二区在线播放| 久久99国产精品久久| 欧美久久久久久久久中文字幕| 成人午夜av影视| 久久久久久久久蜜桃| 少妇一级淫片免费放播放| 亚洲免费资源在线播放| 男人晚上看的视频| 久久99国产精品麻豆| 日韩精品最新网址| 午夜男人的天堂| 亚洲一卡二卡三卡四卡无卡久久| 三级在线观看免费大全| 国产又黄又大久久| 精品国内片67194| 屁屁影院国产第一页| 亚洲午夜日本在线观看| 色欧美88888久久久久久影院| 国产精品1024久久| 久久久久国产精品人| 蜜桃无码一区二区三区| 青青草国产精品97视觉盛宴| 欧美一区二区三区免费| 北京富婆泄欲对白| 一区二区三区四区精品在线视频| 久久久久亚洲av无码专区体验| 国产精品一区二区三区99| 久久色中文字幕| 成人乱码一区二区三区av| 视频一区视频二区在线观看| 51精品国自产在线| 成人区人妻精品一区二| 亚洲第一久久影院| 制服丝袜中文字幕亚洲| youjizz.com国产| 午夜免费欧美电影| 91麻豆精品国产91久久久久| 中文字幕一区二区三区人妻在线视频 | 日韩中文字幕1| 884aa四虎影成人精品一区| 麻豆tv在线观看| 亚洲第一福利视频在线| 91精品欧美一区二区三区综合在| 大尺度做爰床戏呻吟舒畅| 三级一区在线视频先锋| 欧美大片拔萝卜| 国产一二三四五区| 国产做a爰片久久毛片| 国产日韩三级在线| 欧美h片在线观看| 成人av午夜电影| 亚洲欧美激情小说另类| 欧美日韩小视频| 你懂得在线视频| 麻豆精品一区二区av白丝在线| 精品成人一区二区三区四区| 99久久99久久精品免费| 国产黄人亚洲片| 亚洲精品高清在线| 欧美高清激情brazzers| asian性开放少妇pics| 韩国女主播一区二区三区| 日本一区二区不卡视频| 色综合久久中文综合久久97| 潘金莲一级淫片aaaaa| 日韩精品一级中文字幕精品视频免费观看 | 欧美一区午夜精品| 蜜乳av中文字幕| 国产91在线看| 亚洲午夜激情av| 精品国产区一区| 一区二区国产精品精华液| 91小视频免费观看| 日韩精品五月天| 国产日韩欧美a| 欧美在线色视频| 亚洲精品视频大全| 国产69精品久久99不卡| 樱桃视频在线观看一区| 日韩欧美在线不卡| 亚洲精品久久久久久国| av电影中文字幕| 精品一区二区三区影院在线午夜 | 成人av免费在线| 午夜私人影院久久久久| 久久久无码精品亚洲日韩按摩| 色综合色狠狠综合色| 老司机免费视频| 粉嫩一区二区三区性色av| 亚洲国产精品欧美一二99| 久久久亚洲精品石原莉奈| 欧美丝袜自拍制服另类| 免费网站在线高清观看| 91亚洲午夜精品久久久久久| 免费观看成人av| 亚洲视频在线一区观看| 精品国产一区a| 欧美综合天天夜夜久久| 天天躁日日躁aaaa视频| 国产伦理在线观看| 国产毛片精品一区| 午夜日韩在线观看| 国产精品白丝在线| 欧美精品一区二区三区高清aⅴ| 91久久国产最好的精华液| 三级网站在线免费观看| 久久无码人妻一区二区三区| 国产一区二区三区综合| 亚洲国产精品尤物yw在线观看|