• 大小: 0.83M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: 二维码  

资源简介





【核心代码】

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ThoughtWorks.QRCode.Codec;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.TextBox_QrCodeSize.Text = "5";
            this.TextBox_QrCodeVersion.Text = "2";
        }
        
        private void Button1_Click(object sender, EventArgs e)
        {
            Image image;
            try
            {
                QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();
                qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE;
                qrCodeEncoder.QRCodeScale = Convert.ToInt32(TextBox_QrCodeSize.Text);//尺寸
                qrCodeEncoder.QRCodeVersion = Convert.ToInt32(TextBox_QrCodeVersion.Text);//版本
                qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M;
                image = qrCodeEncoder.Encode(TextBox_QrCodeContent.Text);
            }
            catch (Exception ex)
            {
                image = null;
            }
            if (image != null)
            {
                pictureBox1.Image = image;
            }

        }
    }
}

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ThoughtWorks.QRCode.Codec;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.TextBox_QrCodeSize.Text = “5“;
            this.TextBox_QrCodeVersion.Text = “2“;
        }
        
        private void Button1_Click(object sender EventArgs e)
        {
            Image image;
            try
            {
                QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();
                qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        187  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\App.config

     文件    6205440  2016-10-30 18:12  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\ThoughtWorks.QRCode.dll

     文件      10240  2017-01-02 11:18  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe

     文件        187  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config

     文件      22016  2017-01-02 11:18  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb

     文件      23168  2017-01-05 17:30  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe

     文件        187  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.config

     文件        490  2016-07-16 19:44  WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest

     文件       1418  2017-01-02 11:20  WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs

     文件       6119  2017-01-02 11:18  WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs

     文件       5817  2017-01-02 11:18  WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx

     文件       1453  2016-12-20 22:12  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7343  2016-11-30 13:58  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       1426  2017-01-05 17:30  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt

     文件        977  2017-01-02 11:18  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.GenerateResource.Cache

     文件      10240  2017-01-02 11:18  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.exe

     文件        180  2017-01-02 11:18  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form1.resources

     文件      22016  2017-01-02 11:18  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.pdb

     文件        180  2017-01-02 11:18  WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Properties.Resources.resources

     文件        536  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\Program.cs

     文件       1372  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\Properties\AssemblyInfo.cs

     文件       2900  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.Designer.cs

     文件       5612  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.resx

     文件       1111  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Settings.Designer.cs

     文件        249  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1\Properties\Settings.settings

     文件       4028  2016-11-30 13:58  WindowsFormsApplication1\WindowsFormsApplication1\WindowsFormsApplication1.csproj

     文件       1041  2016-11-30 13:51  WindowsFormsApplication1\WindowsFormsApplication1.sln

............此处省略12个文件信息

评论

共有 条评论