資源簡介
生成二維碼,支持中文漢字,指定二維碼中間logo
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.Windows.Forms;
using?System.Runtime.InteropServices;
using?ThoughtWorks.QRCode.Codec;
using?ThoughtWorks.QRCode.Codec.Data;
using?ThoughtWorks.QRCode.Codec.Util;
using?System.IO;
namespace?二維碼測試
{
????public?partial?class?Form1?:?Form
????{
????????private?const?long?WM_GETMINMAXINFO?=?0x24;
????????public?struct?POINTAPI
????????{
????????????public?int?x;
????????????public?int?y;
????????}
????????public?struct?MINMAXINFO
????????{
????????????public?POINTAPI?ptReserved;
????????????public?POINTAPI?ptMaxSize;
????????????public?POINTAPI?ptMaxPosition;
????????????public?POINTAPI?ptMinTrackSize;
????????????public?POINTAPI?ptMaxTrackSize;
????????}
????????public?Form1()
????????{
????????????InitializeComponent();
????????????this.MaximumSize?=?new?Size(Screen.PrimaryScreen.WorkingArea.Width?Screen.PrimaryScreen.WorkingArea.Height);
????????????cbVersion.Text?=?“7“;
????????????cbEncoding.Text?=?“Byte“;
????????????cbCorrectionLevel.Text?=?“M“;
????????????txtData.Text?=?“請輸入數(shù)據(jù)內(nèi)容...“;??
????????????cbScale.Text?=?“5“;
?????
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????this.WindowState?=?FormWindowState.Maximized;????//最大化窗體
????????}
????????//protected?override?void?WndProc(ref?System.Windows.Forms.Message?m)
????????//{
????????//????base.WndProc(ref?m);
????????//????if?(m.Msg?==?WM_GETMINMAXINFO)
????????//????{
????????//????????MINMAXINFO?mmi?=?(MINMAXINFO)m.GetLParam(typeof(MINMAXINFO));
????????//????????mmi.ptMinTrackSize.x?=?this.MinimumSize.Width;
????????//????????mmi.ptMinTrackSize.y?=?this.MinimumSize.Height;
????????//????????if?(this.MaximumSize.Width?!=?0?||?this.MaximumSize.Height?!=?0)
????????//????????{
????????//????????????mmi.ptMaxTrackSize.x?=?this.MaximumSize.Width;
????????//????????????mmi.ptMaxTrackSize.y?=?this.MaximumSize.Height;
????????//????????}
????????//????????mmi.ptMaxPosition.x?=?1;
????????//????????mmi.ptMaxPosition.y?=?1;
????????//????????System.Runtime.InteropServices.Marshal.StructureToPtr(mmi?m.LParam?true);
????????//????}
????????//}
????????///?
????????///?生成二維碼
????????///?
????????///?
????????///?
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
???????????
????????????string?encoding?=?cbEncoding.Text;
????????????string?correctionLever?=?cbCorrectionLevel.Text;
????????????int?version?=?Convert.ToInt32(cbVersion.Text);
????????????int?scale?=?Convert.ToInt32(cbScale.Text);
????????????string?data?=?txtData.Text.Trim();
????????????if?(data?==?string.Empty)
????????????{
????????????????MessageBox.Show(“請輸入數(shù)據(jù)!““警告“?MessageBoxButtons.OK?MessageBoxIcon.Warning);
????????????????re
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2020-12-19?16:16??二維碼測試\
?????目錄???????????0??2020-12-19?16:16??二維碼測試\.vs\
?????目錄???????????0??2020-12-19?16:16??二維碼測試\.vs\二維碼測試\
?????目錄???????????0??2020-12-19?16:16??二維碼測試\.vs\二維碼測試\v14\
?????文件???????27648??2020-12-19?17:52??二維碼測試\.vs\二維碼測試\v14\.suo
?????目錄???????????0??2020-12-19?17:50??二維碼測試\二維碼測試\
?????文件?????????887??2020-12-19?17:53??二維碼測試\二維碼測試.sln
?????文件???????20480??2019-10-23?16:04??二維碼測試\二維碼測試.suo
?????文件?????????134??2020-12-19?17:49??二維碼測試\二維碼測試\app.config
?????目錄???????????0??2019-04-20?16:04??二維碼測試\二維碼測試\bin\
?????目錄???????????0??2020-12-19?17:49??二維碼測試\二維碼測試\bin\Debug\
?????文件?????6209536??2012-03-25?12:12??二維碼測試\二維碼測試\bin\Debug\ThoughtWorks.QRCode.dll
?????文件???????16896??2020-12-19?17:50??二維碼測試\二維碼測試\bin\Debug\二維碼測試.exe
?????文件?????????134??2020-12-19?17:49??二維碼測試\二維碼測試\bin\Debug\二維碼測試.exe.config
?????文件???????26112??2020-12-19?17:50??二維碼測試\二維碼測試\bin\Debug\二維碼測試.pdb
?????文件???????21688??2020-12-19?17:50??二維碼測試\二維碼測試\bin\Debug\二維碼測試.vshost.exe
?????文件?????????134??2020-12-19?17:49??二維碼測試\二維碼測試\bin\Debug\二維碼測試.vshost.exe.config
?????文件?????????490??2019-03-19?12:46??二維碼測試\二維碼測試\bin\Debug\二維碼測試.vshost.exe.manifest
?????文件???????11602??2020-12-19?17:50??二維碼測試\二維碼測試\Form1.cs
?????文件???????15471??2019-10-23?16:03??二維碼測試\二維碼測試\Form1.Designer.cs
?????文件????????6397??2019-10-23?16:03??二維碼測試\二維碼測試\Form1.resx
?????目錄???????????0??2019-04-20?16:04??二維碼測試\二維碼測試\obj\
?????目錄???????????0??2019-04-20?16:04??二維碼測試\二維碼測試\obj\x86\
?????目錄???????????0??2020-12-19?17:50??二維碼測試\二維碼測試\obj\x86\Debug\
?????文件????????3228??2020-12-19?17:49??二維碼測試\二維碼測試\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6332??2020-12-19?17:50??二維碼測試\二維碼測試\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????目錄???????????0??2020-12-19?17:49??二維碼測試\二維碼測試\obj\x86\Debug\TempPE\
?????文件????????3584??2020-12-19?17:49??二維碼測試\二維碼測試\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件????????3137??2020-12-19?17:50??二維碼測試\二維碼測試\obj\x86\Debug\二維碼測試.csproj.FileListAbsolute.txt
?????文件?????????847??2020-12-19?17:50??二維碼測試\二維碼測試\obj\x86\Debug\二維碼測試.csproj.GenerateResource.Cache
?????文件???????24816??2020-12-19?17:49??二維碼測試\二維碼測試\obj\x86\Debug\二維碼測試.csprojResolveAssemblyReference.cache
............此處省略12個文件信息
- 上一篇:PLC通訊170294
- 下一篇:C#編寫藍牙通信程序的簡單
評論
共有 條評論