public ResponseResult Test(QRCodeCreateInput qRCodeCreateInput) { QRCodeCreateEntity qRCodeCreateEntity = QRCodeConvert.ChangeEntity(qRCodeCreateInput); string fileName = QRCoderHelper.CreateQRCodeToFile(qRCodeCreateEntity); return(ResponseResult.Success(fileName)); }
private void button1_Click(object sender, EventArgs e) { string plainText = ""; if (tabControl1.SelectedTab == tabPage1) { //表示需要打印格式文本 if ((textBox_ID.Text.Trim() == string.Empty) && (textBox_Name.Text.Trim() == string.Empty) && (textBox_Time.Text.Trim() == string.Empty)) { pictureBox1.Image = null; return; } // 生成二维码的内容 plainText = "ID編碼:" + textBox_ID.Text + "\r\n客戶名稱:" + textBox_Name.Text + "\r\n出貨日期:" + textBox_Time.Text + "\r\n聯繫電話:" + textBox_phone.Text + "\r\n備註:" + textBox_txt.Text; } //else { // //表示需要打印普通格式文本 // if (textBox_text.Text.Trim() == string.Empty) { // pictureBox1.Image = null; // return; // } // // 生成二维码的内容 // //plainText = "file:///C:/Users/12783/Desktop/C%23、halcon练习/C%23生成二维码/CreateCode/CreateCode/bin/Debug/uncompile.html" + MD5Encrypt(textBox_text.Text) + "&password="******"123456"; //} //创建二维码返回文件路径名称 string fileName = QRCoderHelper.CreateQRCodeToFile(plainText, Convert.ToInt32(comboBox_size.Text)); Code_Number++; SaveProductInfoData(); pictureBox1.Image = Image.FromFile(fileName); }
public object GetPTQRCode(string plainText, int pixel = 5) { var data = new MessageModel <string>(); if (string.IsNullOrEmpty(plainText)) { data.Message = "存储内容不能为空!"; } else { data.Message = "生成成功"; data.Success = true; data.Response = QRCoderHelper.CreateQRCodeToFile(_env.WebRootPath, plainText, pixel); } return(data); }