【文件属性】:
文件名称:无线条码打印机源代码
文件大小:1.39MB
文件格式:RAR
更新时间:2015-05-23 15:02:28
无线 条码 打印机 源代码
无线条码打印机源代码:
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 IRComPort="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;
。。。。。。。。。。。。。。。。。
【文件预览】:
VMP01Print for 2003
----VMP01PrintDoc.cpp(2KB)
----Resource.h(784B)
----VMP01Print.cpp(4KB)
----printerset.h(1KB)
----res()
--------VMP01Print.rc2(420B)
--------Cmdbar.bmp(1014B)
--------VMP01Print.ico(1KB)
----VMP01Print.vcl(1KB)
----comm.cpp(3KB)
----VMP01Print.vcb(89KB)
----VMP01Print.rc(14KB)
----VMP01PrintView.h(2KB)
----VMP01Print.aps(463KB)
----VMP01Print.vco(52KB)
----VMP01Print.h(1KB)
----VMP01Print.vcc(4KB)
----ARMV4Rel()
--------VMP01Print.res(16KB)
--------StdAfx.obj(751B)
--------VMP01PrintDoc.obj(8KB)
--------VMP01PrintView.obj(11KB)
--------VMP01Print.pch(4.29MB)
--------comm.obj(3KB)
--------printerset.obj(8KB)
--------VMP01Print.obj(14KB)
--------VMP01Print.lib(28KB)
--------MainFrm.obj(11KB)
--------VMP01Print.exe(177KB)
--------VMP01Print.exp(22KB)
----VMP01Print.vcp(28KB)
----StdAfx.cpp(208B)
----MainFrm.cpp(3KB)
----MainFrm.h(1KB)
----VMP01PrintView.cpp(3KB)
----StdAfx.h(1KB)
----VMP01PrintDoc.h(1KB)
----printerset.cpp(1KB)
----newres.h(768B)
----comm.h(223B)
----RCa01860(26KB)
----ReadMe.txt(4KB)
----VMP01Print.vcw(548B)