开发工具:
文件大小: 1mb
下载次数: 0
上传时间: 2012-05-02
详细说明: 无线条码打印机源代码: private System.Windows.Forms.TextBox InputTextBox; private System.Windows.Forms.Label label1; private SerialAPI.SerialPort Serial=new SerialAPI.SerialPort(); private System.Windows.Forms.OpenFileDialog openFileDialog1; private Microsoft.WindowsCE.Forms.InputPanel inputPanel1; private System.Windows.Forms.MainMenu mainMenu1; private System.Windows.Forms.MenuItem menuItem1; private System.Windows.Forms.Button ConfigeButton; public string BluetoothComPort="COM8:"; public string IRComP ort="COM3:"; public string ComPort="Bluetooth"; private System.Windows.Forms.Button PrintButton; private System.Windows.Forms.Button OpenFileButton; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; public string Port; public Form1() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // } /// /// 清理所有正在使用的资源。 /// protected override void Dispose( bool disposing ) { base.Dispose( disposing ); } #region Windows 窗体设计器生成的代码 /// /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// private void InitializeComponent() { this.InputTextBox = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.PrintButton = new System.Windows.Forms.Button(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.OpenFileButton = new System.Windows.Forms.Button(); this.inputPanel1 = new Microsoft.WindowsCE.Forms.InputPanel(); this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.ConfigeButton = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); // // InputTextBox // this.InputTextBox.Location = new System.Drawing.Point(8, 24); this.InputTextBox.Multiline = true; this.InputTextBox.Size = new System.Drawing.Size(224, 176); this.InputTextBox.Text = " VMP01 PLUS便携式微型打印机是VMP01系列微型打印机的升级版,除了具有VMP01系列微型打印机同样出色的性能外,在打印质量以及使用方便性上有了提升," + "该微型打印机采用32位ARM CPU作为中央处理器及先进的富士通打印机芯,大大提高了打印速度。为了避免各种票据打印中频繁出现的生僻字(特别是人名),采用了包含2" + "万多汉字的大容量GBK字库。该微型打印机广泛应用在物流、交警、邮政、城管、烟草、抄表等等领域。\r\n\r\n\r\n"; // // label1 // this.label1.Location = new System.Drawing.Point(88, 8); this.label1.Size = new System.Drawing.Size(56, 16); this.label1.Text = "打印内容"; // // PrintButton // this.PrintButton.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular); this.PrintButton.Location = new System.Drawing.Point(8, 208); this.PrintButton.Size = new System.Drawing.Size(56, 22); this.PrintButton.Text = "打印"; this.PrintButton.Click += new System.EventHandler(this.PrintButton_Click); // // openFileDialog1 // this.openFileDialog1.FileName = "发送文件"; this.openFileDialog1.Filter = "文本文件|*.txt"; // // OpenFileButton // this.OpenFileButton.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular); this.OpenFileButton.Location = new System.Drawing.Point(168, 208); this.OpenFileButton.Size = new System.Drawing.Size(64, 22); this.OpenFileButton.Text = "打开文件"; this.OpenFileButton.Click += new System.EventHandler(this.OpenFileButton_Click); // // mainMenu1 // this.mainMenu1.MenuItems.Add(this.menuItem1); // // menuItem1 // this.menuItem1.Text = "退出"; this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); // // ConfigeButton // this.ConfigeButton.Location = new System.Drawing.Point(88, 208); this.ConfigeButton.Size = new System.Drawing.Size(56, 22); this.ConfigeButton.Text = "设置"; this.ConfigeButton.Click += new System.EventHandler(this.ConfigeButton_Click); // // button1 // this.button1.Location = new System.Drawing.Point(8, 238); this.button1.Size = new System.Drawing.Size(56, 22); this.button1.Text = "条码打印"; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // this.button2.Location = new System.Drawing.Point(144, 238); this.button2.Size = new System.Drawing.Size(88, 22); this.button2.Text = "格式文本打印"; this.button2.Click += new System.EventHandler(this.button2_Click); // // Form1 // this.BackColor = System.Drawing.Color.WhiteSmoke; this.ClientSize = new System.Drawing.Size(240, 348); this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.Controls.Add(this.ConfigeButton); this.Controls.Add(this.OpenFileButton); this.Controls.Add(this.PrintButton); this.Controls.Add(this.label1); this.Controls.Add(this.InputTextBox); this.MaximizeBox = false; this.Menu = this.mainMenu1; this.MinimizeBox = false; this.Text = "VMP01 PLUS PRINT DEMO"; } #endregion /// /// 应用程序的主入口点。 /// static void Main() { Application.Run(new Form1()); } private void PrintButton_Click(object sender, System.EventArgs e) { if(InputTextBox.TextLength==0) { return; } this.PrintButton.Enabled=false; this.PrintButton.Update(); Vmp01plusPrint(InputTextBox.Text); this.PrintButton.Enabled=true; } private void OpenFileButton_Click(object sender, System.EventArgs e) { this.OpenFileButton.Enabled=false; this.OpenFileButton.Update(); OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ; openFileDialog1.FilterIndex = 2 ; //读取文本文件并显示 if(openFileDialog1.ShowDialog() == DialogResult.OK) { if (openFileDialog1.FileName!="") { byte[] OutBuffer; FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); OutBuffer = new byte[fs.Length]; OutBuffer=r.ReadBytes((int)fs.Length); fs.Close(); //显示GB编码文本 Encoding ANSIEncoding = Encoding.GetEncoding(0);//or GetEncoding(936); Encoding UnicodeEncoding = Encoding.Unicode; 。。。。。。。。。。。。。。。。。 ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.