• 大小: 2.44MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-28
  • 语言: C#
  • 标签: C#  

资源简介

演示如何创建一个二维码名片工具,内容涉及图片操作、 二维码类库、电子名片、带 Logo 的二维码等知识点。

资源截图

代码片段和文件信息

//======================================================================
//        《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.

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         914  2015-05-21 15:55  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard.sln
     文件       17920  2015-05-21 17:16  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard.suo
     文件       37888  2015-11-18 21:42  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard.v12.suo
     目录           0  2016-03-25 21:36  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\
     文件        1748  2015-07-04 19:44  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Apps-tux-icon.png
     目录           0  2016-03-25 21:36  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\
     目录           0  2016-03-25 21:36  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\
     文件     6205440  2010-12-04 14:18  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\ThoughtWorks.QRCode.dll
     文件       18432  2015-11-14 14:05  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\TwoDimensionCodeNameCard.exe
     文件       34304  2015-11-14 14:05  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\TwoDimensionCodeNameCard.pdb
     文件       21656  2015-11-18 21:05  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\TwoDimensionCodeNameCard.vshost.exe
     文件         490  2010-03-17 22:39  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\bin\Debug\TwoDimensionCodeNameCard.vshost.exe.manifest
     文件        6097  2016-03-10 09:53  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Form1.cs
     文件       16036  2016-03-10 09:53  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Form1.Designer.cs
     文件        6427  2015-05-21 16:34  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\Form1.resx
     目录           0  2016-03-25 21:36  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\
     目录           0  2016-03-25 21:36  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\
     目录           0  2016-03-25 21:36  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\
     文件         791  2015-07-04 19:45  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6319  2015-11-14 14:03  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         678  2015-05-21 17:16  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\GenerateResource-ResGen.read.1.tlog
     文件        1206  2015-05-21 17:16  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\GenerateResource-ResGen.write.1.tlog
     目录           0  2016-03-25 21:36  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\TempPE\
     文件        4608  2015-07-04 19:48  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll
     文件        2676  2015-11-18 21:06  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\TwoDimensionCodeNameCard.csproj.FileListAbsolute.txt
     文件         884  2015-07-04 19:53  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\TwoDimensionCodeNameCard.csproj.GenerateResource.Cache
     文件        5672  2015-07-04 19:49  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\TwoDimensionCodeNameCard.csprojResolveAssemblyReference.cache
     文件       18432  2015-11-14 14:05  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\TwoDimensionCodeNameCard.exe
     文件         180  2015-07-04 19:49  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\TwoDimensionCodeNameCard.Form1.resources
     文件       34304  2015-11-14 14:05  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\TwoDimensionCodeNameCard.pdb
     文件        2130  2015-07-04 19:49  TwoDimensionCodeNameCard\TwoDimensionCodeNameCard\obj\x86\Debug\TwoDimensionCodeNameCard.Properties.Resources.resources
............此处省略10个文件信息

评论

共有 条评论