资源简介
C# 生成二维码名片 实例源码
代码片段和文件信息
//======================================================================
// 《31天学会CRM项目开发》机械工业出版社 版权所有 (C) 2015-2016
// 文件名:Form1.cs
// 随书附赠源代码,若转发需保留版权信息。
// 社区支持:http://www.huiyaosoft.com/
//======================================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace TwoDimensionCodeNameCard
{
public partial class Form1 : Form
{
private string appPath = System.Windows.Forms.Application.StartupPath + “\\“;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender EventArgs e)
{
this.tsInfo.Text = “右键可将二维码名片另存为图片“;
this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
#region init
this.tbCompany.Text = “青岛**软件有限公司“;
this.tbAddr.Text = “青岛市市南区香港路100号(266500)“;
this.tbUrl.Text = “www.huiyaosoft.com“;
this.tbFax.Text = “+86 0532 86887777“;
this.tbDepa.Text = “ERP事业部“;
this.tbtitle.Text = “技术总监“;
this.tbMobile.Text = “+86 18605327777“;
this.tbPhone.Text = “+86 0532 86887778“;
this.tbMail.Text = “admin@huiyaosoft.com“;
this.tbName.Text = “张三“;
#endregion
}
private void btnBuild_Click(object sender EventArgs e)
{
buildCode();
//挪车二维码
//Bitmap b = GetTwoDimensionCode(“车主:戴先生\r\n联系电话:18511111111\r\n临时停车给您带来的不变敬请谅解!“ “扫一扫获取挪车电话“ this.pictureBox1.Width this.pictureBox1.Height “微软雅黑“);
//this.pictureBox1.Image = b;
}
private void buildCode()
{
try
{
StringBuilder card = new StringBuilder();
card.Append(“BEGIN:VCARD“);
card.Append(“\r\nFN:“ + this.tbName.Text);
card.Append(“\r\ntitle:“ + this.tbtitle.Text);
card.Append(“\r\nORG:“ + this.tbCompany.Text + “;“ + this.tbDepa.Text);
card.Append(“\r\nTEL;CELL:“ + this.tbMobile.Text);
card.Append(“\r\nTEL;WORK:“ + this.tbPhone.Text);
card.Append(“\r\nTEL;WORK;FAX:“ + this.tbFax.Text);
card.Append(“\r\nADR;WORK:“ + this.tbAddr.Text);
card.Append(“\r\nURL:“ + this.tbUrl.Text);
card.Append(“\r\nEMAIL;WORK:“ + this.tbMail.Text);
card.Append(“\r\nNOTE:“);
card.Append(“\r\nX-QQ:“);
card.Append(“\r\nPHOTO;ENCODING=b;TYPE=JPEG:“);
card.Append(“\r\nEND:VCARD\r\n“);
//card.ToString()
Bitmap b = GetTwoDimensionCode(card.ToString() string.Empty
this.pictureBox1.Width this.pictureBox1.
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-10-18 21:23 TwoDimensionCodeNameCard\
目录 0 2019-10-18 21:23 TwoDimensionCodeNameCard\.vs\
目录 0 2019-10-18 21:23 TwoDimensionCodeNameCard\.vs\TwoDimensionCodeNameCard\
目录 0 2019-10-18 21:23 TwoDimensionCodeNameCard\.vs\TwoDimensionCodeNameCard\v15\
文件 43520 2019-10-18 21:24 TwoDimensionCodeNameCard\.vs\TwoDimensionCodeNameCard\v15\.suo
目录 0 2019-10-18 21:23 TwoDimensionCodeNameCard\.vs\TwoDimensionCodeNameCard\v15\Server\
目录 0 2019-10-18 21:23 TwoDimensionCodeNameCard\.vs\TwoDimensionCodeNameCard\v15\Server\sqlite3\
文件 0 2019-10-18 21:23 TwoDimensionCodeNameCard\.vs\TwoDimensionCodeNameCard\v15\Server\sqlite3\db.lock
文件 4096 2019-10-18 21:23 TwoDimensionCodeNameCard\.vs\TwoDimensionCodeNameCard\v15\Server\sqlite3\storage.ide
文件 32768 2019-10-18 21:23 TwoDimensionCodeNameCard\.vs\TwoDimensionCodeNameCard\v15\Server\sqlite3\storage.ide-shm
文件 560352 2019-10-18 21:23 TwoDimensionCodeNameCard\.vs\TwoDimensionCodeNameCard\v15\Server\sqlite3\storage.ide-wal
目录 0 2019-10-18 21:23 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\
文件 1748 2015-07-04 19:44 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Apps-tux-icon.png
文件 16036 2016-03-10 09:53 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Form1.Designer.cs
文件 6097 2016-03-10 09:53 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Form1.cs
文件 6427 2015-05-21 16:34 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Form1.resx
文件 881 2016-03-10 09:53 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Program.cs
目录 0 2019-10-18 21:23 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Properties\
文件 1781 2016-03-10 09:53 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Properties\AssemblyInfo.cs
文件 3679 2016-03-10 09:53 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Properties\Resources.Designer.cs
文件 6203 2015-07-04 19:48 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Properties\Resources.resx
文件 1515 2016-03-10 09:53 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Properties\Settings.Designer.cs
文件 249 2015-05-21 15:55 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Properties\Settings.settings
文件 6205440 2010-12-04 14:18 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\ThoughtWorks.QRCode.dll
文件 3684 2015-07-04 19:48 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\TwoDimensionCodeNameCard.csproj
目录 0 2019-10-18 21:23 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\
目录 0 2019-10-18 21:23 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\
文件 6205440 2010-12-04 14:18 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\ThoughtWorks.QRCode.dll
文件 18432 2019-10-18 21:23 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\TwoDimensionCodeNameCard.exe
文件 26112 2019-10-18 21:23 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\TwoDimensionCodeNameCard.pdb
文件 21656 2015-11-18 21:05 TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\TwoDimensionCodeNameCard.vshost.exe
............此处省略24个文件信息
评论
共有 条评论