C#怎么调用bartender软件

 时间:2024-10-28 06:26:50

1、准备bartender软件的dll调用文件,根据自己安装的bartender软件的版本来准备,后续会因调用bartender软件的模板而失败。

C#怎么调用bartender软件

3、在项目管理引用中添加引用我们第一步准备好的bartender调用连接dll文件。

C#怎么调用bartender软件

5、编写源代码,我这里附上全部源代码供参考。using System;using System.Collections.Generic;using System.Compo荏鱿胫协nentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;using System.Runtime.InteropServices;namespace BlueTooth{ public partial class Form1 : Form { string PalletID1; public static BarTender.Application btapp1; public static BarTender.Format btFormat1; public Form1() { InitializeComponent(); } private void BasicSet1() { string str1 = System.Windows.Forms.Application.StartupPath + "\\bluet.btw"; btapp1 = new BarTender.ApplicationClass(); btFormat1 = btapp1.Formats.Open(str1, false, ""); } private void Form1_Load(object sender, EventArgs e) { BasicSet1(); } public void PrintLabel(string PalletID1) { btFormat1.SetNamedSubStringValue("TEST", PalletID1); btFormat1.IdenticalCopiesOfLabel = 1; btFormat1.PrintOut(false, false); } private void print(string label) { PalletID1 = textBox1.Text.Trim(); PrintLabel(PalletID1); } private void button1_Click(object sender, EventArgs e) { print(textBox1.Text.Trim()); } private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { print(textBox1.Text.Trim()); textBox1.SelectAll(); } } }}

C#怎么调用bartender软件
  • ReportViewer使用详解
  • 加入家庭组遇到错误怎么办
  • 怎么设置Windows2008系统服务器远程桌面连接
  • windows 7系统如何调试摄像头?
  • Oracle使用:[1]Clob类型使用方法
  • 热门搜索
    什么地方旅游最好 旅游路线设计方案 辽源旅游景点大全 邮船旅游 浙江省内旅游景点 大连旅游社 福州旅游公司 中国旅游摄影网 去澳大利亚旅游签证 金华旅游团