POS机C井例子代码(1)

这篇博客展示了如何使用C#进行POS机控制,包括端口打开、关闭、设备状态读取、时间设置等功能,涉及多种控件和方法的使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

 

 

 

 

 

详细代码

 

 

 

 

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

//广州荣士电子有限公司,联系电话020-82318861,82322852,定制13826029618 网址http://www.icmcu.com
namespace POS机C井例子代码
{
 /// <summary>
 /// Form1 的摘要说明。
 /// </summary>
 public class Form1 : System.Windows.Forms.Form
 {
  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.Button button2;
  private System.Windows.Forms.GroupBox groupBox1;
  private System.Windows.Forms.Label label1;
  private System.Windows.Forms.Label label2;
  private System.Windows.Forms.Label label3;
  private System.Windows.Forms.Label label4;
  private System.Windows.Forms.Label label5;
  private System.Windows.Forms.Label label6;
  private System.Windows.Forms.Label label7;
  private System.Windows.Forms.Label label8;
  private System.Windows.Forms.TextBox textBox1;
  private System.Windows.Forms.TextBox textBox2;
  private System.Windows.Forms.TextBox textBox3;
  private System.Windows.Forms.TextBox textBox4;
  private System.Windows.Forms.TextBox textBox5;
  private System.Windows.Forms.TextBox textBox6;
  private System.Windows.Forms.Label label9;
  private System.Windows.Forms.Label label10;
  private System.Windows.Forms.Label label11;
  private System.Windows.Forms.TextBox textBox7;
  private System.Windows.Forms.TextBox textBox8;
  private System.Windows.Forms.TextBox textBox9;
  private System.Windows.Forms.TextBox textBox10;
  private System.Windows.Forms.TextBox textBox11;
  private System.Windows.Forms.TextBox textBox12;
  private System.Windows.Forms.TextBox textBox13;
  private System.Windows.Forms.Label label12;
  private System.Windows.Forms.Label label13;
  private System.Windows.Forms.Label label14;
  private System.Windows.Forms.Label label15;
  private System.Windows.Forms.Label label16;
  private System.Windows.Forms.Label label17;
  private System.Windows.Forms.Label label18;
  private System.Windows.Forms.Label label19;
  private System.Windows.Forms.Label label20;
  private System.Windows.Forms.Label label21;
  private System.Windows.Forms.Label label22;
  private System.Windows.Forms.TextBox textBox14;
  private System.Windows.Forms.TextBox textBox15;
  private System.Windows.Forms.TextBox textBox17;
  private System.Windows.Forms.TextBox textBox18;
  private System.Windows.Forms.Button button3;
  private System.Windows.Forms.Button button4;
  private System.Windows.Forms.Button button5;
  private System.Windows.Forms.Button button6;
  private System.Windows.Forms.Button button7;
  private System.Windows.Forms.Button button8;
  private System.Windows.Forms.Button button9;
  private System.Windows.Forms.GroupBox groupBox2;
  private System.Windows.Forms.Label label23;
  private System.Windows.Forms.Label label24;
  private System.Windows.Forms.Label label25;
  private System.Windows.Forms.Label label26;
  private System.Windows.Forms.Button button10;
  public  System.Windows.Forms.TextBox textBox16;
  private System.Windows.Forms.TextBox textBox19;
  private System.Windows.Forms.ComboBox comboBox1;
  private System.Windows.Forms.Button button11;
  private System.Windows.Forms.Button button12;
  private System.Windows.Forms.CheckBox checkBox1;
  private System.Windows.Forms.CheckBox checkBox2;
  private System.Windows.Forms.CheckBox checkBox3;
  private System.Windows.Forms.CheckBox checkBox4;
  private System.Windows.Forms.TextBox textBox20;
  private System.Windows.Forms.Label label27;
  private System.Windows.Forms.TextBox textBox21;
  private System.Windows.Forms.Label label28;
  private System.Windows.Forms.TextBox textBox22;
  private System.Windows.Forms.Label label29;
  private System.Windows.Forms.TextBox textBox23;
  private System.Windows.Forms.TextBox textBox24;
  private System.Windows.Forms.Label label30;
  private System.Windows.Forms.Button button13;
  private System.Windows.Forms.Button button14;
  private System.Windows.Forms.Label label31;
  private System.Windows.Forms.TextBox textBox25;
  private System.Windows.Forms.Button button15;
  private System.Windows.Forms.Button button16;
  private System.Windows.Forms.Button button17;
  private System.Windows.Forms.Label label32;
  private System.Windows.Forms.ComboBox comboBox2;
  private System.Windows.Forms.Label label33;
  private System.Windows.Forms.TextBox textBox26;
  private System.Windows.Forms.Button button18;
  private System.Windows.Forms.Button button19;
  private System.Windows.Forms.TextBox textBox27;
  private System.Windows.Forms.TextBox textBox28;
  private System.Windows.Forms.Button button20;
  private System.Windows.Forms.Label label34;
  private System.Windows.Forms.Button button21;
  private System.Windows.Forms.ListView listView1;
  private System.Windows.Forms.Label label35;
  private System.Windows.Forms.Label label36;
  private System.Windows.Forms.Label label37;
  private System.Windows.Forms.Label label38;
  private System.Windows.Forms.Label label39;
  private System.Windows.Forms.Label label40;
  private System.Windows.Forms.TextBox textBox29;
  private System.Windows.Forms.TextBox textBox30;
  private System.Windows.Forms.TextBox textBox31;
  private System.Windows.Forms.TextBox textBox32;
  private System.Windows.Forms.TextBox textBox33;
  private System.Windows.Forms.TextBox textBox34;
  private System.Windows.Forms.TextBox textBox35;
  private System.Windows.Forms.TextBox textBox36;
  private System.Windows.Forms.TextBox textBox37;
  private System.Windows.Forms.TextBox textBox38;
  private System.Windows.Forms.Button button22;
  private System.Windows.Forms.Button button23;
  private System.Windows.Forms.CheckBox checkBox5;
  private System.Windows.Forms.CheckBox checkBox6;
  private System.Windows.Forms.CheckBox checkBox7;
  private System.Windows.Forms.CheckBox checkBox8;
  private System.Windows.Forms.ColumnHeader columnHeader1;
  private System.Windows.Forms.ColumnHeader columnHeader2;
  private System.Windows.Forms.ColumnHeader columnHeader3;
  private System.Windows.Forms.ColumnHeader columnHeader4;
  private System.Windows.Forms.ColumnHeader columnHeader5;
  private System.Windows.Forms.ColumnHeader columnHeader6;
  private System.Windows.Forms.ColumnHeader columnHeader7;
  public  AxPOS01Lib.AxPOS01 axPOS011;

  /// <summary>
  /// 必需的设计器变量。
  /// </summary>
  private System.ComponentModel.Container components = null;

  public Form1()
  {
   //
   // Windows 窗体设计器支持所必需的
   //
   InitializeComponent();

   //
   // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
   //
  }

  /// <summary>
  /// 清理所有正在使用的资源。
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if (components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region Windows 窗体设计器生成的代码
  /// <summary>
  /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  /// 此方法的内容。
  /// </summary>
  private void InitializeComponent()
  {
   System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
   this.button1 = new System.Windows.Forms.Button();
   this.button2 = new System.Windows.Forms.Button();
   this.groupBox1 = new System.Windows.Forms.GroupBox();
   this.button9 = new System.Windows.Forms.Button();
   this.button8 = new System.Windows.Forms.Button();
   this.button7 = new System.Windows.Forms.Button();
   this.button6 = new System.Windows.Forms.Button();
   this.button5 = new System.Windows.Forms.Button();
   this.button4 = new System.Windows.Forms.Button();
   this.button3 = new System.Windows.Forms.Button();
   this.textBox18 = new System.Windows.Forms.TextBox();
   this.textBox17 = new System.Windows.Forms.TextBox();
   this.textBox15 = new System.Windows.Forms.TextBox();
   this.textBox14 = new System.Windows.Forms.TextBox();
   this.label22 = new System.Windows.Forms.Label();
   this.label21 = new System.Windows.Forms.Label();
   this.label20 = new System.Windows.Forms.Label();
   this.label19 = new System.Windows.Forms.Label();
   this.label18 = new System.Windows.Forms.Label();
   this.label17 = new System.Windows.Forms.Label();
   this.label16 = new System.Windows.Forms.Label();
   this.label15 = new System.Windows.Forms.Label();
   this.label14 = new System.Windows.Forms.Label();
   this.label13 = new System.Windows.Forms.Label();
   this.label12 = new System.Windows.Forms.Label();
   this.textBox13 = new System.Windows.Forms.TextBox();
   this.textBox12 = new System.Windows.Forms.TextBox();
   this.textBox11 = new System.Windows.Forms.TextBox();
   this.textBox10 = new System.Windows.Forms.TextBox();
   this.textBox9 = new System.Windows.Forms.TextBox();
   this.textBox8 = new System.Windows.Forms.TextBox();
   this.textBox7 = new System.Windows.Forms.TextBox();
   this.label11 = new System.Windows.Forms.Label();
   this.label10 = new System.Windows.Forms.Label();
   this.label9 = new System.Windows.Forms.Label();
   this.textBox6 = new System.Windows.Forms.TextBox();
   this.textBox5 = new System.Windows.Forms.TextBox();
   this.textBox4 = new System.Windows.Forms.TextBox();
   this.textBox3 = new System.Windows.Forms.TextBox();
   this.textBox2 = new System.Windows.Forms.TextBox();
   this.textBox1 = new System.Windows.Forms.TextBox();
   this.label8 = new System.Windows.Forms.Label();
   this.label7 = new System.Windows.Forms.Label();
   this.label6 = new System.Windows.Forms.Label();
   this.label5 = new System.Windows.Forms.Label();
   this.label4 = new System.Windows.Forms.Label();
   this.label3 = new System.Windows.Forms.Label();
   this.label2 = new System.Windows.Forms.Label();
   this.label1 = new System.Windows.Forms.Label();
   this.groupBox2 = new System.Windows.Forms.GroupBox();
   this.checkBox8 = new System.Windows.Forms.CheckBox();
   this.checkBox7 = new System.Windows.Forms.CheckBox();
   this.checkBox6 = new System.Windows.Forms.CheckBox();
   this.checkBox5 = new System.Windows.Forms.CheckBox();
   this.button23 = new System.Windows.Forms.Button();
   this.button22 = new System.Windows.Forms.Button();
   this.textBox38 = new System.Windows.Forms.TextBox();
   this.textBox37 = new System.Windows.Forms.TextBox();
   this.textBox36 = new System.Windows.Forms.TextBox();
   this.textBox35 = new System.Windows.Forms.TextBox();
   this.textBox34 = new System.Windows.Forms.TextBox();
   this.textBox33 = new System.Windows.Forms.TextBox();
   this.textBox32 = new System.Windows.Forms.TextBox();
   this.textBox31 = new System.Windows.Forms.TextBox();
   this.textBox30 = new System.Windows.Forms.TextBox();
   this.textBox29 = new System.Windows.Forms.TextBox();
   this.label40 = new System.Windows.Forms.Label();
   this.label39 = new System.Windows.Forms.Label();
   this.label38 = new System.Windows.Forms.Label();
   this.label37 = new System.Windows.Forms.Label();
   this.label36 = new System.Windows.Forms.Label();
   this.label35 = new System.Windows.Forms.Label();
   this.listView1 = new System.Windows.Forms.ListView();
   this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
   this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
   this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
   this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
   this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
   this.columnHeader6 = new System.Windows.Forms.ColumnHeader();
   this.columnHeader7 = new System.Windows.Forms.ColumnHeader();
   this.button21 = new System.Windows.Forms.Button();
   this.label34 = new System.Windows.Forms.Label();
   this.button20 = new System.Windows.Forms.Button();
   this.textBox28 = new System.Windows.Forms.TextBox();
   this.textBox27 = new System.Windows.Forms.TextBox();
   this.button19 = new System.Windows.Forms.Button();
   this.button18 = new System.Windows.Forms.Button();
   this.textBox26 = new System.Windows.Forms.TextBox();
   this.label33 = new System.Windows.Forms.Label();
   this.comboBox2 = new System.Windows.Forms.ComboBox();
   this.label32 = new System.Windows.Forms.Label();
   this.button17 = new System.Windows.Forms.Button();
   this.button16 = new System.Windows.Forms.Button();
   this.button15 = new System.Windows.Forms.Button();
   this.textBox25 = new System.Windows.Forms.TextBox();
   this.label31 = new System.Windows.Forms.Label();
   this.button14 = new System.Windows.Forms.Button();
   this.button13 = new System.Windows.Forms.Button();
   this.label30 = new System.Windows.Forms.Label();
   this.textBox24 = new System.Windows.Forms.TextBox();
   this.textBox23 = new System.Windows.Forms.TextBox();
   this.label29 = new System.Windows.Forms.Label();
   this.textBox22 = new System.Windows.Forms.TextBox();
   this.label28 = new System.Windows.Forms.Label();
   this.textBox21 = new System.Windows.Forms.TextBox();
   this.label27 = new System.Windows.Forms.Label();
   this.textBox20 = new System.Windows.Forms.TextBox();
   this.checkBox4 = new System.Windows.Forms.CheckBox();
   this.checkBox3 = new System.Windows.Forms.CheckBox();
   this.checkBox2 = new System.Windows.Forms.CheckBox();
   this.checkBox1 = new System.Windows.Forms.CheckBox();
   this.button12 = new System.Windows.Forms.Button();
   this.button11 = new System.Windows.Forms.Button();
   this.comboBox1 = new System.Windows.Forms.ComboBox();
   this.textBox19 = new System.Windows.Forms.TextBox();
   this.textBox16 = new System.Windows.Forms.TextBox();
   this.button10 = new System.Windows.Forms.Button();
   this.label26 = new System.Windows.Forms.Label();
   this.label25 = new System.Windows.Forms.Label();
   this.label24 = new System.Windows.Forms.Label();
   this.label23 = new System.Windows.Forms.Label();
   this.axPOS011 = new AxPOS01Lib.AxPOS01();
   this.groupBox1.SuspendLayout();
   this.groupBox2.SuspendLayout();
   ((System.ComponentModel.ISupportInitialize)(this.axPOS011)).BeginInit();
   this.SuspendLayout();
   //
   // button1
   //
   this.button1.Location = new System.Drawing.Point(48, 160);
   this.button1.Name = "button1";
   this.button1.Size = new System.Drawing.Size(104, 32);
   this.button1.TabIndex = 1;
   this.button1.Text = "POSPcbBeep";
   this.button1.Click += new System.EventHandler(this.button1_Click);
   //
   // button2
   //
   this.button2.Location = new System.Drawing.Point(184, 160);
   this.button2.Name = "button2";
   this.button2.Size = new System.Drawing.Size(112, 32);
   this.button2.TabIndex = 2;
   this.button2.Text = "POSCardRead";
   this.button2.Click += new System.EventHandler(this.button2_Click);
   //
   // groupBox1
   //
   this.groupBox1.Controls.Add(this.button9);
   this.groupBox1.Controls.Add(this.button8);
   this.groupBox1.Controls.Add(this.button7);
   this.groupBox1.Controls.Add(this.button6);
   this.groupBox1.Controls.Add(this.button5);
   this.groupBox1.Controls.Add(this.button4);
   this.groupBox1.Controls.Add(this.button3);
   this.groupBox1.Controls.Add(this.textBox18);
   this.groupBox1.Controls.Add(this.textBox17);
   this.groupBox1.Controls.Add(this.textBox15);
   this.groupBox1.Controls.Add(this.textBox14);
   this.groupBox1.Controls.Add(this.label22);
   this.groupBox1.Controls.Add(this.label21);
   this.groupBox1.Controls.Add(this.label20);
   this.groupBox1.Controls.Add(this.label19);
   this.groupBox1.Controls.Add(this.label18);
   this.groupBox1.Controls.Add(this.label17);
   this.groupBox1.Controls.Add(this.label16);
   this.groupBox1.Controls.Add(this.label15);
   this.groupBox1.Controls.Add(this.label14);
   this.groupBox1.Controls.Add(this.label13);
   this.groupBox1.Controls.Add(this.label12);
   this.groupBox1.Controls.Add(this.textBox13);
   this.groupBox1.Controls.Add(this.textBox12);
   this.groupBox1.Controls.Add(this.textBox11);
   this.groupBox1.Controls.Add(this.textBox10);
   this.groupBox1.Controls.Add(this.textBox9);
   this.groupBox1.Controls.Add(this.textBox8);
   this.groupBox1.Controls.Add(this.textBox7);
   this.groupBox1.Controls.Add(this.label11);
   this.groupBox1.Controls.Add(this.label10);
   this.groupBox1.Controls.Add(this.label9);
   this.groupBox1.Controls.Add(this.textBox6);
   this.groupBox1.Controls.Add(this.textBox5);
   this.groupBox1.Controls.Add(this.textBox4);
   this.groupBox1.Controls.Add(this.textBox3);
   this.groupBox1.Controls.Add(this.textBox2);
   this.groupBox1.Controls.Add(this.textBox1);
   this.groupBox1.Controls.Add(this.label8);
   this.groupBox1.Controls.Add(this.label7);
   this.groupBox1.Controls.Add(this.label6);
   this.groupBox1.Controls.Add(this.label5);
   this.groupBox1.Controls.Add(this.label4);
   this.groupBox1.Controls.Add(this.label3);
   this.groupBox1.Controls.Add(this.label2);
   this.groupBox1.Controls.Add(this.label1);
   this.groupBox1.Controls.Add(this.button2);
   this.groupBox1.Controls.Add(this.button1);
   this.groupBox1.Location = new System.Drawing.Point(16, 16);
   this.groupBox1.Name = "groupBox1";
   this.groupBox1.Size = new System.Drawing.Size(1032, 264);
   this.groupBox1.TabIndex = 3;
   this.groupBox1.TabStop = false;
   this.groupBox1.Text = "IC卡操作管理";
   //
   // button9
   //
   this.button9.Location = new System.Drawing.Point(656, 216);
   this.button9.Name = "button9";
   this.button9.Size = new System.Drawing.Size(328, 32);
   this.button9.TabIndex = 49;
   this.button9.Text = "清空消费卡";
   this.button9.Click += new System.EventHandler(this.button9_Click);
   //
   // button8
   //
   this.button8.Location = new System.Drawing.Point(656, 168);
   this.button8.Name = "button8";
   this.button8.Size = new System.Drawing.Size(328, 32);
   this.button8.TabIndex = 48;
   this.button8.Text = "出厂卡初始化成消费卡";
   this.button8.Click += new System.EventHandler(this.button8_Click);
   //
   // button7
   //
   this.button7.Location = new System.Drawing.Point(656, 80);
   this.button7.Name = "button7";
   this.button7.Size = new System.Drawing.Size(328, 32);
   this.button7.TabIndex = 47;
   this.button7.Text = "清空密码卡";
   this.button7.Click += new System.EventHandler(this.button7_Click);
   //
   // button6
   //
   this.button6.Location = new System.Drawing.Point(656, 32);
   this.button6.Name = "button6";
   this.button6.Size = new System.Drawing.Size(328, 32);
   this.button6.TabIndex = 46;
   this.button6.Text = "制作密码卡,用于刷卡更改批定POS机的消费卡区号密码";
   this.button6.Click += new System.EventHandler(this.button6_Click);
   //
   // button5
   //
   this.button5.Location = new System.Drawing.Point(496, 216);
   this.button5.Name = "button5";
   this.button5.Size = new System.Drawing.Size(80, 32);
   this.button5.TabIndex = 45;
   this.button5.Text = "POS退费";
   this.button5.Click += new System.EventHandler(this.button5_Click);
   //
   // button4
   //
   this.button4.Location = new System.Drawing.Point(184, 216);
   this.button4.Name = "button4";
   this.button4.Size = new System.Drawing.Size(80, 32);
   this.button4.TabIndex = 44;
   this.button4.Text = "POS充值";
   this.button4.Click += new System.EventHandler(this.button4_Click);
   //
   // button3
   //
   this.button3.Location = new System.Drawing.Point(328, 160);
   this.button3.Name = "button3";
   this.button3.Size = new System.Drawing.Size(104, 32);
   this.button3.TabIndex = 43;
   this.button3.Text = "POSCardWrite";
   this.button3.Click += new System.EventHandler(this.button3_Click);
   //
   // textBox18
   //
   this.textBox18.Location = new System.Drawing.Point(64, 224);
   this.textBox18.Name = "textBox18";
   this.textBox18.Size = new System.Drawing.Size(64, 21);
   this.textBox18.TabIndex = 42;
   this.textBox18.Text = "0";
   //
   // textBox17
   //
   this.textBox17.Location = new System.Drawing.Point(368, 224);
   this.textBox17.Name = "textBox17";
   this.textBox17.Size = new System.Drawing.Size(64, 21);
   this.textBox17.TabIndex = 41;
   this.textBox17.Text = "0";
   //
   // textBox15
   //
   this.textBox15.Location = new System.Drawing.Point(568, 120);
   this.textBox15.Name = "textBox15";
   this.textBox15.Size = new System.Drawing.Size(64, 21);
   this.textBox15.TabIndex = 39;
   this.textBox15.Text = "0";
   //
   // textBox14
   //
   this.textBox14.Location = new System.Drawing.Point(528, 96);
   this.textBox14.Name = "textBox14";
   this.textBox14.Size = new System.Drawing.Size(80, 21);
   this.textBox14.TabIndex = 38;
   this.textBox14.Text = "0";
   //
   // label22
   //
   this.label22.Location = new System.Drawing.Point(328, 224);
   this.label22.Name = "label22";
   this.label22.Size = new System.Drawing.Size(40, 23);
   this.label22.TabIndex = 37;
   this.label22.Text = "退费";
   //
   // label21
   //
   this.label21.Location = new System.Drawing.Point(448, 224);
   this.label21.Name = "label21";
   this.label21.TabIndex = 36;
   this.label21.Text = "分钱";
   //
   // label20
   //
   this.label20.Location = new System.Drawing.Point(136, 224);
   this.label20.Name = "label20";
   this.label20.Size = new System.Drawing.Size(48, 23);
   this.label20.TabIndex = 35;
   this.label20.Text = "分钱";
   //
   // label19
   //
   this.label19.Location = new System.Drawing.Point(416, 128);
   this.label19.Name = "label19";
   this.label19.Size = new System.Drawing.Size(144, 23);
   this.label19.TabIndex = 34;
   this.label19.Text = "当餐超过需按密码的金额";
   //
   // label18
   //
   this.label18.Location = new System.Drawing.Point(416, 104);
   this.label18.Name = "label18";
   this.label18.Size = new System.Drawing.Size(104, 23);
   this.label18.TabIndex = 33;
   this.label18.Text = "当餐累计消费次数";
   //
   // label17
   //
   this.label17.Location = new System.Drawing.Point(16, 224);
   this.label17.Name = "label17";
   this.label17.Size = new System.Drawing.Size(64, 23);
   this.label17.TabIndex = 32;
   this.label17.Text = "充值";
   //
   // label16
   //
   this.label16.Location = new System.Drawing.Point(376, 128);
   this.label16.Name = "label16";
   this.label16.Size = new System.Drawing.Size(40, 23);
   this.label16.TabIndex = 31;
   this.label16.Text = "分钱";
   //
   // label15
   //
   this.label15.Location = new System.Drawing.Point(448, 72);
   this.label15.Name = "label15";
   this.label15.Size = new System.Drawing.Size(72, 23);
   this.label15.TabIndex = 30;
   this.label15.Text = "日,餐次:";
   //
   // label14
   //
   this.label14.Location = new System.Drawing.Point(376, 104);
   this.label14.Name = "label14";
   this.label14.Size = new System.Drawing.Size(40, 23);
   this.label14.TabIndex = 29;
   this.label14.Text = "分钱";
   //
   // label13
   //
   this.label13.Location = new System.Drawing.Point(328, 72);
   this.label13.Name = "label13";
   this.label13.Size = new System.Drawing.Size(24, 23);
   this.label13.TabIndex = 28;
   this.label13.Text = "年";
   //
   // label12
   //
   this.label12.Location = new System.Drawing.Point(384, 72);
   this.label12.Name = "label12";
   this.label12.Size = new System.Drawing.Size(24, 23);
   this.label12.TabIndex = 27;
   this.label12.Text = "月";
   //
   // textBox13
   //
   this.textBox13.Location = new System.Drawing.Point(288, 120);
   this.textBox13.Name = "textBox13";
   this.textBox13.Size = new System.Drawing.Size(88, 21);
   this.textBox13.TabIndex = 26;
   this.textBox13.Text = "0";
   //
   // textBox12
   //
   this.textBox12.Location = new System.Drawing.Point(288, 96);
   this.textBox12.Name = "textBox12";
   this.textBox12.Size = new System.Drawing.Size(88, 21);
   this.textBox12.TabIndex = 25;
   this.textBox12.Text = "0";
   //
   // textBox11
   //
   this.textBox11.Location = new System.Drawing.Point(528, 72);
   this.textBox11.Name = "textBox11";
   this.textBox11.Size = new System.Drawing.Size(64, 21);
   this.textBox11.TabIndex = 24;
   this.textBox11.Text = "0";
   //
   // textBox10
   //
   this.textBox10.Location = new System.Drawing.Point(408, 72);
   this.textBox10.Name = "textBox10";
   this.textBox10.Size = new System.Drawing.Size(40, 21);
   this.textBox10.TabIndex = 23;
   this.textBox10.Text = "00";
   //
   // textBox9
   //
   this.textBox9.Location = new System.Drawing.Point(352, 72);
   this.textBox9.Name = "textBox9";
   this.textBox9.Size = new System.Drawing.Size(40, 21);
   this.textBox9.TabIndex = 22;
   this.textBox9.Text = "00";
   //
   // textBox8
   //
   this.textBox8.Location = new System.Drawing.Point(288, 72);
   this.textBox8.Name = "textBox8";
   this.textBox8.Size = new System.Drawing.Size(40, 21);
   this.textBox8.TabIndex = 21;
   this.textBox8.Text = "00";
   //
   // textBox7
   //
   this.textBox7.Location = new System.Drawing.Point(288, 48);
   this.textBox7.Name = "textBox7";
   this.textBox7.Size = new System.Drawing.Size(72, 21);
   this.textBox7.TabIndex = 20;
   this.textBox7.Text = "0";
   //
   // label11
   //
   this.label11.Location = new System.Drawing.Point(360, 48);
   this.label11.Name = "label11";
   this.label11.Size = new System.Drawing.Size(56, 23);
   this.label11.TabIndex = 19;
   this.label11.Text = "分钱";
   //
   // label10
   //
   this.label10.Location = new System.Drawing.Point(176, 128);
   this.label10.Name = "label10";
   this.label10.Size = new System.Drawing.Size(112, 23);
   this.label10.TabIndex = 18;
   this.label10.Text = "当天累计消费金额";
   //
   // label9
   //
   this.label9.Location = new System.Drawing.Point(176, 96);
   this.label9.Name = "label9";
   this.label9.Size = new System.Drawing.Size(112, 23);
   this.label9.TabIndex = 17;
   this.label9.Text = "当餐累计消费金额";
   //
   // textBox6
   //
   this.textBox6.Location = new System.Drawing.Point(288, 24);
   this.textBox6.Name = "textBox6";
   this.textBox6.Size = new System.Drawing.Size(72, 21);
   this.textBox6.TabIndex = 16;
   this.textBox6.Text = "张三";
   //
   // textBox5
   //
   this.textBox5.Location = new System.Drawing.Point(88, 120);
   this.textBox5.Name = "textBox5";
   this.textBox5.Size = new System.Drawing.Size(72, 21);
   this.textBox5.TabIndex = 15;
   this.textBox5.Text = "0";
   //
   // textBox4
   //
   this.textBox4.Location = new System.Drawing.Point(88, 96);
   this.textBox4.Name = "textBox4";
   this.textBox4.Size = new System.Drawing.Size(72, 21);
   this.textBox4.TabIndex = 14;
   this.textBox4.Text = "0";
   //
   // textBox3
   //
   this.textBox3.Location = new System.Drawing.Point(88, 72);
   this.textBox3.Name = "textBox3";
   this.textBox3.Size = new System.Drawing.Size(72, 21);
   this.textBox3.TabIndex = 13;
   this.textBox3.Text = "00001";
   //
   // textBox2
   //
   this.textBox2.Location = new System.Drawing.Point(88, 48);
   this.textBox2.Name = "textBox2";
   this.textBox2.Size = new System.Drawing.Size(72, 21);
   this.textBox2.TabIndex = 12;
   this.textBox2.Text = "01";
   //
   // textBox1
   //
   this.textBox1.Location = new System.Drawing.Point(88, 24);
   this.textBox1.Name = "textBox1";
   this.textBox1.Size = new System.Drawing.Size(72, 21);
   this.textBox1.TabIndex = 11;
   this.textBox1.Text = "01";
   //
   // label8
   //
   this.label8.Location = new System.Drawing.Point(184, 72);
   this.label8.Name = "label8";
   this.label8.TabIndex = 10;
   this.label8.Text = "最后消费餐次";
   //
   // label7
   //
   this.label7.Location = new System.Drawing.Point(184, 48);
   this.label7.Name = "label7";
   this.label7.TabIndex = 9;
   this.label7.Text = "卡 金 额";
   //
   // label6
   //
   this.label6.Location = new System.Drawing.Point(184, 24);
   this.label6.Name = "label6";
   this.label6.TabIndex = 8;
   this.label6.Text = "持卡人姓名";
   //
   // label5
   //
   this.label5.Location = new System.Drawing.Point(8, 128);
   this.label5.Name = "label5";
   this.label5.Size = new System.Drawing.Size(72, 23);
   this.label5.TabIndex = 7;
   this.label5.Text = "持卡人密码";
   //
   // label4
   //
   this.label4.Location = new System.Drawing.Point(8, 96);
   this.label4.Name = "label4";
   this.label4.Size = new System.Drawing.Size(56, 23);
   this.label4.TabIndex = 6;
   this.label4.Text = "充值次数";
   //
   // label3
   //
   this.label3.Location = new System.Drawing.Point(8, 72);
   this.label3.Name = "label3";
   this.label3.Size = new System.Drawing.Size(56, 23);
   this.label3.TabIndex = 5;
   this.label3.Text = "自编卡号";
   //
   // label2
   //
   this.label2.Location = new System.Drawing.Point(8, 48);
   this.label2.Name = "label2";
   this.label2.Size = new System.Drawing.Size(56, 23);
   this.label2.TabIndex = 4;
   this.label2.Text = "卡 类 别";
   //
   // label1
   //
   this.label1.Location = new System.Drawing.Point(8, 24);
   this.label1.Name = "label1";
   this.label1.Size = new System.Drawing.Size(56, 23);
   this.label1.TabIndex = 3;
   this.label1.Text = "单位代码";
   //
   // groupBox2
   //
   this.groupBox2.BackColor = System.Drawing.SystemColors.ActiveBorder;
   this.groupBox2.Controls.Add(this.checkBox8);
   this.groupBox2.Controls.Add(this.checkBox7);
   this.groupBox2.Controls.Add(this.checkBox6);
   this.groupBox2.Controls.Add(this.checkBox5);
   this.groupBox2.Controls.Add(this.button23);
   this.groupBox2.Controls.Add(this.button22);
   this.groupBox2.Controls.Add(this.textBox38);
   this.groupBox2.Controls.Add(this.textBox37);
   this.groupBox2.Controls.Add(this.textBox36);
   this.groupBox2.Controls.Add(this.textBox35);
   this.groupBox2.Controls.Add(this.textBox34);
   this.groupBox2.Controls.Add(this.textBox33);
   this.groupBox2.Controls.Add(this.textBox32);
   this.groupBox2.Controls.Add(this.textBox31);
   this.groupBox2.Controls.Add(this.textBox30);
   this.groupBox2.Controls.Add(this.textBox29);
   this.groupBox2.Controls.Add(this.label40);
   this.groupBox2.Controls.Add(this.label39);
   this.groupBox2.Controls.Add(this.label38);
   this.groupBox2.Controls.Add(this.label37);
   this.groupBox2.Controls.Add(this.label36);
   this.groupBox2.Controls.Add(this.label35);
   this.groupBox2.Controls.Add(this.listView1);
   this.groupBox2.Controls.Add(this.button21);
   this.groupBox2.Controls.Add(this.label34);
   this.groupBox2.Controls.Add(this.button20);
   this.groupBox2.Controls.Add(this.textBox28);
   this.groupBox2.Controls.Add(this.textBox27);
   this.groupBox2.Controls.Add(this.button19);
   this.groupBox2.Controls.Add(this.button18);
   this.groupBox2.Controls.Add(this.textBox26);
   this.groupBox2.Controls.Add(this.label33);
   this.groupBox2.Controls.Add(this.comboBox2);
   this.groupBox2.Controls.Add(this.label32);
   this.groupBox2.Controls.Add(this.button17);
   this.groupBox2.Controls.Add(this.button16);
   this.groupBox2.Controls.Add(this.button15);
   this.groupBox2.Controls.Add(this.textBox25);
   this.groupBox2.Controls.Add(this.label31);
   this.groupBox2.Controls.Add(this.button14);
   this.groupBox2.Controls.Add(this.button13);
   this.groupBox2.Controls.Add(this.label30);
   this.groupBox2.Controls.Add(this.textBox24);
   this.groupBox2.Controls.Add(this.textBox23);
   this.groupBox2.Controls.Add(this.label29);
   this.groupBox2.Controls.Add(this.textBox22);
   this.groupBox2.Controls.Add(this.label28);
   this.groupBox2.Controls.Add(this.textBox21);
   this.groupBox2.Controls.Add(this.label27);
   this.groupBox2.Controls.Add(this.textBox20);
   this.groupBox2.Controls.Add(this.checkBox4);
   this.groupBox2.Controls.Add(this.checkBox3);
   this.groupBox2.Controls.Add(this.checkBox2);
   this.groupBox2.Controls.Add(this.checkBox1);
   this.groupBox2.Controls.Add(this.button12);
   this.groupBox2.Controls.Add(this.button11);
   this.groupBox2.Controls.Add(this.comboBox1);
   this.groupBox2.Controls.Add(this.textBox19);
   this.groupBox2.Controls.Add(this.textBox16);
   this.groupBox2.Controls.Add(this.button10);
   this.groupBox2.Controls.Add(this.label26);
   this.groupBox2.Controls.Add(this.label25);
   this.groupBox2.Controls.Add(this.label24);
   this.groupBox2.Controls.Add(this.label23);
   this.groupBox2.Location = new System.Drawing.Point(16, 288);
   this.groupBox2.Name = "groupBox2";
   this.groupBox2.Size = new System.Drawing.Size(1032, 424);
   this.groupBox2.TabIndex = 4;
   this.groupBox2.TabStop = false;
   this.groupBox2.Text = "通讯操作";
   //
   // checkBox8
   //
   this.checkBox8.Location = new System.Drawing.Point(504, 272);
   this.checkBox8.Name = "checkBox8";
   this.checkBox8.Size = new System.Drawing.Size(112, 24);
   this.checkBox8.TabIndex = 65;
   this.checkBox8.Text = "远程电脑IP地址";
   //
   // checkBox7
   //
   this.checkBox7.Location = new System.Drawing.Point(368, 272);
   this.checkBox7.Name = "checkBox7";
   this.checkBox7.Size = new System.Drawing.Size(48, 24);
   this.checkBox7.TabIndex = 64;
   this.checkBox7.Text = "端口";
   //
   // checkBox6
   //
   this.checkBox6.Location = new System.Drawing.Point(216, 272);
   this.checkBox6.Name = "checkBox6";
   this.checkBox6.Size = new System.Drawing.Size(48, 24);
   this.checkBox6.TabIndex = 63;
   this.checkBox6.Text = "网关";
   //
   // checkBox5
   //
   this.checkBox5.Location = new System.Drawing.Point(16, 272);
   this.checkBox5.Name = "checkBox5";
   this.checkBox5.Size = new System.Drawing.Size(80, 24);
   this.checkBox5.TabIndex = 62;
   this.checkBox5.Text = "子网掩码";
   //
   // button23
   //
   this.button23.Location = new System.Drawing.Point(768, 272);
   this.button23.Name = "button23";
   this.button23.Size = new System.Drawing.Size(216, 23);
   this.button23.TabIndex = 61;
   this.button23.Text = "批量更改所有联网模块的部分参数";
   this.button23.Click += new System.EventHandler(this.button23_Click);
   //
   // button22
   //
   this.button22.Location = new System.Drawing.Point(904, 240);
   this.button22.Name = "button22";
   this.button22.Size = new System.Drawing.Size(80, 23);
   this.button22.TabIndex = 60;
   this.button22.Text = "更改模块参数";
   this.button22.Click += new System.EventHandler(this.button22_Click);
   //
   // textBox38
   //
   this.textBox38.Location = new System.Drawing.Point(624, 272);
   this.textBox38.Name = "textBox38";
   this.textBox38.TabIndex = 59;
   this.textBox38.Text = "255.255.255.255";
   //
   // textBox37
   //
   this.textBox37.Location = new System.Drawing.Point(416, 272);
   this.textBox37.Name = "textBox37";
   this.textBox37.Size = new System.Drawing.Size(80, 21);
   this.textBox37.TabIndex = 58;
   this.textBox37.Text = "39190";
   //
   // textBox36
   //
   this.textBox36.Location = new System.Drawing.Point(264, 272);
   this.textBox36.Name = "textBox36";
   this.textBox36.TabIndex = 57;
   this.textBox36.Text = "192.168.1.1";
   //
   // textBox35
   //
   this.textBox35.Location = new System.Drawing.Point(112, 272);
   this.textBox35.Name = "textBox35";
   this.textBox35.TabIndex = 56;
   this.textBox35.Text = "255.255.255.0";
   //
   // textBox34
   //
   this.textBox34.Location = new System.Drawing.Point(600, 240);
   this.textBox34.Name = "textBox34";
   this.textBox34.TabIndex = 55;
   this.textBox34.Text = "255.255.255.255";
   //
   // textBox33
   //
   this.textBox33.Location = new System.Drawing.Point(784, 240);
   this.textBox33.Name = "textBox33";
   this.textBox33.Size = new System.Drawing.Size(80, 21);
   this.textBox33.TabIndex = 54;
   this.textBox33.Text = "0000000000";
   //
   // textBox32
   //
   this.textBox32.Location = new System.Drawing.Point(464, 240);
   this.textBox32.Name = "textBox32";
   this.textBox32.Size = new System.Drawing.Size(48, 21);
   this.textBox32.TabIndex = 53;
   this.textBox32.Text = "39190";
   //
   // textBox31
   //
   this.textBox31.Location = new System.Drawing.Point(344, 240);
   this.textBox31.Name = "textBox31";
   this.textBox31.Size = new System.Drawing.Size(88, 21);
   this.textBox31.TabIndex = 52;
   this.textBox31.Text = "192.168.1.1";
   //
   // textBox30
   //
   this.textBox30.Location = new System.Drawing.Point(224, 240);
   this.textBox30.Name = "textBox30";
   this.textBox30.Size = new System.Drawing.Size(88, 21);
   this.textBox30.TabIndex = 51;
   this.textBox30.Text = "255.255.255.0";
   //
   // textBox29
   //
   this.textBox29.Location = new System.Drawing.Point(80, 240);
   this.textBox29.Name = "textBox29";
   this.textBox29.Size = new System.Drawing.Size(88, 21);
   this.textBox29.TabIndex = 50;
   this.textBox29.Text = "192.168.1.228";
   //
   // label40
   //
   this.label40.Location = new System.Drawing.Point(712, 240);
   this.label40.Name = "label40";
   this.label40.Size = new System.Drawing.Size(72, 23);
   this.label40.TabIndex = 47;
   this.label40.Text = "模块硬件号";
   //
   // label39
   //
   this.label39.Location = new System.Drawing.Point(520, 240);
   this.label39.Name = "label39";
   this.label39.Size = new System.Drawing.Size(80, 23);
   this.label39.TabIndex = 46;
   this.label39.Text = "远程电脑IP";
   //
   // label38
   //
   this.label38.Location = new System.Drawing.Point(432, 240);
   this.label38.Name = "label38";
   this.label38.Size = new System.Drawing.Size(40, 23);
   this.label38.TabIndex = 45;
   this.label38.Text = "端口";
   //
   // label37
   //
   this.label37.Location = new System.Drawing.Point(312, 240);
   this.label37.Name = "label37";
   this.label37.Size = new System.Drawing.Size(32, 23);
   this.label37.TabIndex = 44;
   this.label37.Text = "网关";
   //
   // label36
   //
   this.label36.Location = new System.Drawing.Point(168, 240);
   this.label36.Name = "label36";
   this.label36.Size = new System.Drawing.Size(56, 23);
   this.label36.TabIndex = 43;
   this.label36.Text = "子网掩码";
   //
   // label35
   //
   this.label35.Location = new System.Drawing.Point(16, 240);
   this.label35.Name = "label35";
   this.label35.Size = new System.Drawing.Size(72, 23);
   this.label35.TabIndex = 42;
   this.label35.Text = "模块IP地址";
   //
   // listView1
   //
   this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                      this.columnHeader1,
                      this.columnHeader2,
                      this.columnHeader3,
                      this.columnHeader4,
                      this.columnHeader5,
                      this.columnHeader6,
                      this.columnHeader7});
   this.listView1.Location = new System.Drawing.Point(16, 128);
   this.listView1.Name = "listView1";
   this.listView1.Size = new System.Drawing.Size(1000, 104);
   this.listView1.TabIndex = 41;
   this.listView1.View = System.Windows.Forms.View.Details;
   //
   // columnHeader1
   //
   this.columnHeader1.Text = "模块IP地址";
   this.columnHeader1.Width = 131;
   //
   // columnHeader2
   //
   this.columnHeader2.Text = "子网掩码";
   this.columnHeader2.Width = 117;
   //
   // columnHeader3
   //
   this.columnHeader3.Text = "网关";
   this.columnHeader3.Width = 121;
   //
   // columnHeader4
   //
   this.columnHeader4.Text = "端口";
   this.columnHeader4.Width = 99;
   //
   // columnHeader5
   //
   this.columnHeader5.Text = "远程电脑IP地址";
   this.columnHeader5.Width = 140;
   //
   // columnHeader6
   //
   this.columnHeader6.Text = "模块MAC地址";
   this.columnHeader6.Width = 140;
   //
   // columnHeader7
   //
   this.columnHeader7.Text = "模块硬件号";
   this.columnHeader7.Width = 140;
   //
   // button21
   //
   this.button21.Location = new System.Drawing.Point(672, 88);
   this.button21.Name = "button21";
   this.button21.Size = new System.Drawing.Size(104, 32);
   this.button21.TabIndex = 40;
   this.button21.Text = "清空列表";
   this.button21.Click += new System.EventHandler(this.button21_Click);
   //
   // label34
   //
   this.label34.Location = new System.Drawing.Point(176, 96);
   this.label34.Name = "label34";
   this.label34.Size = new System.Drawing.Size(224, 23);
   this.label34.TabIndex = 39;
   //
   // button20
   //
   this.button20.Location = new System.Drawing.Point(16, 88);
   this.button20.Name = "button20";
   this.button20.Size = new System.Drawing.Size(136, 32);
   this.button20.TabIndex = 38;
   this.button20.Text = "搜寻所有联网的模块";
   this.button20.Click += new System.EventHandler(this.button20_Click);
   //
   // textBox28
   //
   this.textBox28.Location = new System.Drawing.Point(904, 56);
   this.textBox28.Name = "textBox28";
   this.textBox28.Size = new System.Drawing.Size(120, 21);
   this.textBox28.TabIndex = 37;
   this.textBox28.Text = "";
   //
   // textBox27
   //
   this.textBox27.Location = new System.Drawing.Point(792, 56);
   this.textBox27.Name = "textBox27";
   this.textBox27.TabIndex = 36;
   this.textBox27.Text = "";
   //
   // button19
   //
   this.button19.Location = new System.Drawing.Point(584, 48);
   this.button19.Name = "button19";
   this.button19.Size = new System.Drawing.Size(200, 32);
   this.button19.TabIndex = 35;
   this.button19.Text = "读取电脑IP地址及网卡MAC地址>>";
   this.button19.Click += new System.EventHandler(this.button19_Click);
   //
   // button18
   //
   this.button18.Location = new System.Drawing.Point(504, 48);
   this.button18.Name = "button18";
   this.button18.Size = new System.Drawing.Size(64, 32);
   this.button18.TabIndex = 34;
   this.button18.Text = "PING";
   this.button18.Click += new System.EventHandler(this.button18_Click);
   //
   // textBox26
   //
   this.textBox26.Location = new System.Drawing.Point(408, 56);
   this.textBox26.Name = "textBox26";
   this.textBox26.Size = new System.Drawing.Size(88, 21);
   this.textBox26.TabIndex = 33;
   this.textBox26.Text = "192.168.1.218";
   //
   // label33
   //
   this.label33.Location = new System.Drawing.Point(360, 56);
   this.label33.Name = "label33";
   this.label33.Size = new System.Drawing.Size(48, 23);
   this.label33.TabIndex = 32;
   this.label33.Text = "IP地址";
   //
   // comboBox2
   //
   this.comboBox2.Items.AddRange(new object[] {
                 "RS-485",
                 "以太网TCPIP",
                 "433MHz无线通讯"});
   this.comboBox2.Location = new System.Drawing.Point(64, 24);
   this.comboBox2.Name = "comboBox2";
   this.comboBox2.Size = new System.Drawing.Size(96, 20);
   this.comboBox2.TabIndex = 31;
   this.comboBox2.Text = "RS-485";
   //
   // label32
   //
   this.label32.Location = new System.Drawing.Point(8, 24);
   this.label32.Name = "label32";
   this.label32.Size = new System.Drawing.Size(56, 16);
   this.label32.TabIndex = 30;
   this.label32.Text = "通讯方式";
   //
   // button17
   //
   this.button17.Location = new System.Drawing.Point(488, 384);
   this.button17.Name = "button17";
   this.button17.Size = new System.Drawing.Size(208, 32);
   this.button17.TabIndex = 29;
   this.button17.Text = "打开设备参数远程设定与读取窗口";
   this.button17.Click += new System.EventHandler(this.button17_Click);
   //
   // button16
   //
   this.button16.Location = new System.Drawing.Point(232, 384);
   this.button16.Name = "button16";
   this.button16.Size = new System.Drawing.Size(216, 32);
   this.button16.TabIndex = 28;
   this.button16.Text = "打开IC卡挂失操作窗口";
   this.button16.Click += new System.EventHandler(this.button16_Click);
   //
   // button15
   //
   this.button15.Location = new System.Drawing.Point(24, 384);
   this.button15.Name = "button15";
   this.button15.Size = new System.Drawing.Size(176, 32);
   this.button15.TabIndex = 27;
   this.button15.Text = "打开消费记录操作窗口";
   this.button15.Click += new System.EventHandler(this.button15_Click);
   //
   // textBox25
   //
   this.textBox25.Location = new System.Drawing.Point(664, 344);
   this.textBox25.Name = "textBox25";
   this.textBox25.Size = new System.Drawing.Size(64, 21);
   this.textBox25.TabIndex = 26;
   this.textBox25.Text = "0";
   //
   // label31
   //
   this.label31.Location = new System.Drawing.Point(608, 344);
   this.label31.Name = "label31";
   this.label31.Size = new System.Drawing.Size(56, 23);
   this.label31.TabIndex = 25;
   this.label31.Text = "总挂失数";
   //
   // button14
   //
   this.button14.Location = new System.Drawing.Point(912, 336);
   this.button14.Name = "button14";
   this.button14.Size = new System.Drawing.Size(104, 32);
   this.button14.TabIndex = 24;
   this.button14.Text = "设定时间至设备";
   this.button14.Click += new System.EventHandler(this.button14_Click);
   //
   // button13
   //
   this.button13.Location = new System.Drawing.Point(832, 336);
   this.button13.Name = "button13";
   this.button13.Size = new System.Drawing.Size(72, 32);
   this.button13.TabIndex = 23;
   this.button13.Text = "读取时间";
   this.button13.Click += new System.EventHandler(this.button13_Click);
   //
   // label30
   //
   this.label30.Location = new System.Drawing.Point(536, 344);
   this.label30.Name = "label30";
   this.label30.Size = new System.Drawing.Size(16, 23);
   this.label30.TabIndex = 22;
   this.label30.Text = ":";
   //
   // textBox24
   //
   this.textBox24.Location = new System.Drawing.Point(552, 344);
   this.textBox24.Name = "textBox24";
   this.textBox24.Size = new System.Drawing.Size(48, 21);
   this.textBox24.TabIndex = 21;
   this.textBox24.Text = "00";
   //
   // textBox23
   //
   this.textBox23.Location = new System.Drawing.Point(504, 344);
   this.textBox23.Name = "textBox23";
   this.textBox23.Size = new System.Drawing.Size(32, 21);
   this.textBox23.TabIndex = 20;
   this.textBox23.Text = "00";
   //
   // label29
   //
   this.label29.Location = new System.Drawing.Point(488, 344);
   this.label29.Name = "label29";
   this.label29.Size = new System.Drawing.Size(16, 23);
   this.label29.TabIndex = 19;
   this.label29.Text = ":";
   //
   // textBox22
   //
   this.textBox22.Location = new System.Drawing.Point(456, 344);
   this.textBox22.Name = "textBox22";
   this.textBox22.Size = new System.Drawing.Size(32, 21);
   this.textBox22.TabIndex = 18;
   this.textBox22.Text = "00";
   //
   // label28
   //
   this.label28.Location = new System.Drawing.Point(440, 344);
   this.label28.Name = "label28";
   this.label28.Size = new System.Drawing.Size(16, 23);
   this.label28.TabIndex = 17;
   this.label28.Text = "日";
   //
   // textBox21
   //
   this.textBox21.Location = new System.Drawing.Point(416, 344);
   this.textBox21.Name = "textBox21";
   this.textBox21.Size = new System.Drawing.Size(32, 21);
   this.textBox21.TabIndex = 16;
   this.textBox21.Text = "00";
   //
   // label27
   //
   this.label27.Location = new System.Drawing.Point(400, 344);
   this.label27.Name = "label27";
   this.label27.Size = new System.Drawing.Size(16, 23);
   this.label27.TabIndex = 15;
   this.label27.Text = "月";
   //
   // textBox20
   //
   this.textBox20.Location = new System.Drawing.Point(376, 344);
   this.textBox20.Name = "textBox20";
   this.textBox20.Size = new System.Drawing.Size(32, 21);
   this.textBox20.TabIndex = 14;
   this.textBox20.Text = "00";
   //
   // checkBox4
   //
   this.checkBox4.Location = new System.Drawing.Point(272, 328);
   this.checkBox4.Name = "checkBox4";
   this.checkBox4.Size = new System.Drawing.Size(56, 40);
   this.checkBox4.TabIndex = 13;
   this.checkBox4.Text = "通讯加密";
   //
   // checkBox3
   //
   this.checkBox3.Location = new System.Drawing.Point(208, 328);
   this.checkBox3.Name = "checkBox3";
   this.checkBox3.Size = new System.Drawing.Size(64, 40);
   this.checkBox3.TabIndex = 12;
   this.checkBox3.Text = "设备时间正确";
   //
   // checkBox2
   //
   this.checkBox2.Location = new System.Drawing.Point(160, 328);
   this.checkBox2.Name = "checkBox2";
   this.checkBox2.Size = new System.Drawing.Size(48, 40);
   this.checkBox2.TabIndex = 11;
   this.checkBox2.Text = "纪录已满";
   //
   // checkBox1
   //
   this.checkBox1.Location = new System.Drawing.Point(112, 328);
   this.checkBox1.Name = "checkBox1";
   this.checkBox1.Size = new System.Drawing.Size(48, 40);
   this.checkBox1.TabIndex = 10;
   this.checkBox1.Text = "有新纪录";
   //
   // button12
   //
   this.button12.Location = new System.Drawing.Point(736, 336);
   this.button12.Name = "button12";
   this.button12.Size = new System.Drawing.Size(96, 32);
   this.button12.TabIndex = 9;
   this.button12.Text = "<<取电脑时间";
   this.button12.Click += new System.EventHandler(this.button12_Click);
   //
   // button11
   //
   this.button11.Location = new System.Drawing.Point(8, 328);
   this.button11.Name = "button11";
   this.button11.Size = new System.Drawing.Size(96, 32);
   this.button11.TabIndex = 8;
   this.button11.Text = "查看设备状态";
   this.button11.Click += new System.EventHandler(this.button11_Click);
   //
   // comboBox1
   //
   this.comboBox1.Items.AddRange(new object[] {
                 "COM1",
                 "COM2",
                 "COM3",
                 "COM4",
                 "COM5",
                 "COM6",
                 "COM7",
                 "COM8",
                 "COM9",
                 "COM10",
                 "COM11",
                 "COM12",
                 "COM13",
                 "COM14",
                 "COM15",
                 "COM16",
                 "COM17",
                 "COM18",
                 "COM19",
                 "COM20"});
   this.comboBox1.Location = new System.Drawing.Point(56, 56);
   this.comboBox1.Name = "comboBox1";
   this.comboBox1.Size = new System.Drawing.Size(80, 20);
   this.comboBox1.TabIndex = 7;
   this.comboBox1.Text = "COM1";
   //
   // textBox19
   //
   this.textBox19.Location = new System.Drawing.Point(328, 344);
   this.textBox19.Name = "textBox19";
   this.textBox19.Size = new System.Drawing.Size(32, 21);
   this.textBox19.TabIndex = 6;
   this.textBox19.Text = "00";
   //
   // textBox16
   //
   this.textBox16.Location = new System.Drawing.Point(176, 56);
   this.textBox16.Name = "textBox16";
   this.textBox16.Size = new System.Drawing.Size(72, 21);
   this.textBox16.TabIndex = 5;
   this.textBox16.Text = "002";
   //
   // button10
   //
   this.button10.Location = new System.Drawing.Point(256, 48);
   this.button10.Name = "button10";
   this.button10.Size = new System.Drawing.Size(88, 32);
   this.button10.TabIndex = 4;
   this.button10.Text = "打开端口";
   this.button10.Click += new System.EventHandler(this.button10_Click);
   //
   // label26
   //
   this.label26.Location = new System.Drawing.Point(360, 344);
   this.label26.Name = "label26";
   this.label26.Size = new System.Drawing.Size(16, 23);
   this.label26.TabIndex = 3;
   this.label26.Text = "年";
   //
   // label25
   //
   this.label25.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128)));
   this.label25.ForeColor = System.Drawing.Color.MediumBlue;
   this.label25.Location = new System.Drawing.Point(8, 304);
   this.label25.Name = "label25";
   this.label25.Size = new System.Drawing.Size(1000, 16);
   this.label25.TabIndex = 2;
   this.label25.Text = "设备状态查询与设备时间管理";
   //
   // label24
   //
   this.label24.Location = new System.Drawing.Point(144, 56);
   this.label24.Name = "label24";
   this.label24.Size = new System.Drawing.Size(48, 23);
   this.label24.TabIndex = 1;
   this.label24.Text = "机号";
   //
   // label23
   //
   this.label23.Location = new System.Drawing.Point(8, 56);
   this.label23.Name = "label23";
   this.label23.Size = new System.Drawing.Size(48, 23);
   this.label23.TabIndex = 0;
   this.label23.Text = "串  口";
   //
   // axPOS011
   //
   this.axPOS011.Enabled = true;
   this.axPOS011.Location = new System.Drawing.Point(56, 0);
   this.axPOS011.Name = "axPOS011";
   this.axPOS011.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axPOS011.OcxState")));
   this.axPOS011.Size = new System.Drawing.Size(288, 24);
   this.axPOS011.TabIndex = 5;
   //
   // Form1
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.BackColor = System.Drawing.SystemColors.ActiveBorder;
   this.ClientSize = new System.Drawing.Size(1072, 726);
   this.Controls.Add(this.axPOS011);
   this.Controls.Add(this.groupBox2);
   this.Controls.Add(this.groupBox1);
   this.Name = "Form1";
   this.Text = "Form1";
   this.Load += new System.EventHandler(this.Form1_Load);
   this.groupBox1.ResumeLayout(false);
   this.groupBox2.ResumeLayout(false);
   ((System.ComponentModel.ISupportInitialize)(this.axPOS011)).EndInit();
   this.ResumeLayout(false);

  }
  #endregion

  /// <summary>
  /// 应用程序的主入口点。
  /// </summary>
  [STAThread]
  static void Main()
  {
   Application.Run(new Form1());
  }

  private void button1_Click(object sender, System.EventArgs e)
  {
  axPOS011.PcdBeep(38);
  }

  private void button2_Click(object sender, System.EventArgs e)
   {
   axPOS011.CardAreaNumber=8;
   axPOS011.CardKeyHexStr = "888888888888" ;  //密码
            axPOS011.CardRead();
   if (axPOS011.OperatingResults ==0 )
   {
    axPOS011.PcdBeep(38);
    textBox1.Text=Convert.ToString(axPOS011.CardUnit);  //卡区域
    textBox2.Text=Convert.ToString(axPOS011.CardClass) ;  //卡类别
    textBox3.Text =Convert.ToString(axPOS011.CardCustomNumberStr);
    textBox4.Text =Convert.ToString(axPOS011.CardRechargeTimes);
    textBox5.Text=axPOS011.CardHolderPwdStr;
    textBox6.Text=axPOS011.CardHolderName;  //持卡人姓名
    textBox7.Text =Convert.ToString(axPOS011.CardMoney);      //卡金额
    textBox8.Text =Convert.ToString(axPOS011.CardLastYear);   //最后消费时间
    textBox9.Text =Convert.ToString(axPOS011.CardLastMonth);
    textBox10.Text =Convert.ToString(axPOS011.CardLastDay);
    textBox11.Text =Convert.ToString(axPOS011.CardLastMealType);
    textBox12.Text =Convert.ToString(axPOS011.CardLastMealMoney);
    textBox14.Text =Convert.ToString(axPOS011.CardLastMealTimes);
    
    textBox13.Text =Convert.ToString(axPOS011.CardLastDayMoney);
    textBox15.Text =Convert.ToString(axPOS011.CardLastDayNeedPwdMoney);

    MessageBox.Show( "读卡成功");}
           else  if (axPOS011.OperatingResults ==8 )
            {
      MessageBox.Show( "寻不到卡");

         }

     else if(axPOS011.OperatingResults ==60)
        {
         MessageBox.Show( "卡金额乱码");

         }


           else
        {    
         MessageBox.Show( Convert.ToString(axPOS011.OperatingResults));
        }
   }
   
   
   

  private void button3_Click(object sender, System.EventArgs e)
  {
  
            axPOS011.CardAreaNumber=8;  //写卡
   axPOS011.CardKeyHexStr ="888888888888" ;  //密码

 

   axPOS011.CardUnit = Convert.ToInt16(textBox1.Text) ;              //单位代码
            axPOS011.CardClass = Convert.ToInt16(textBox2.Text) ;             //卡类别
            axPOS011.CardCustomNumberStr =textBox3.Text ;              //自编卡号
            axPOS011.CardRechargeTimes = Convert.ToInt32(textBox4.Text) ;    //充值次料
            axPOS011.CardHolderPwdStr = textBox5.Text  ;                //持卡人密码
            axPOS011.CardHolderName = textBox6.Text     ;               //持卡人姓名
            axPOS011.CardMoney = Convert.ToInt32(textBox7.Text)     ;        //卡金额
            axPOS011.CardLastYear = Convert.ToInt16(textBox8.Text)   ;        //年
            axPOS011.CardLastMonth = Convert.ToInt16(textBox9.Text)   ;       //'月
            axPOS011.CardLastDay = Convert.ToInt16(textBox10.Text)     ;      //'日
            axPOS011.CardLastMealType = Convert.ToInt16(textBox11.Text) ;     //餐次:0为早餐,1为中餐,2为晚餐,3为夜宵
            axPOS011.CardLastMealMoney = Convert.ToInt32(textBox12.Text);
            axPOS011.CardLastMealTimes = Convert.ToInt16(textBox14.Text);
            axPOS011.CardLastDayMoney = Convert.ToInt32(textBox13.Text);
            axPOS011.CardLastDayNeedPwdMoney = Convert.ToInt32(textBox15.Text);
   
            axPOS011.CardWrite() ;
   if (axPOS011.OperatingResults == 0 )
   {
                 axPOS011.PcdBeep(38);
               MessageBox.Show( "写金额成功!");
     
         }

 

  }

  private void button9_Click(object sender, System.EventArgs e)
  {
     
    axPOS011.CardAreaNumber = 8 ;         // '区号
    axPOS011.CardKeyHexStr = "888888888888" ;              // '密码
    axPOS011.CardHaltEn = 1   ;                 // '初始化后休眠该卡,之后必须拿开卡再放回感应区卡才能做其他操作

    axPOS011.CardClear() ;
    if (axPOS011.OperatingResults == 0)
     {
      axPOS011.PcdBeep(38);
      MessageBox.Show( "卡片清空成功!");

     }
    else if (axPOS011.OperatingResults == 8 )
     {
      MessageBox.Show ("寻不到卡!");
     }
    else
     {
           
      MessageBox.Show( Convert.ToString(axPOS011.OperatingResults));

     }


  }

  private void button4_Click(object sender, System.EventArgs e)
  {
   axPOS011.CardAreaNumber = 8   ;     //区号
            axPOS011.CardKeyHexStr = "888888888888"  ;    //密码
   
            axPOS011.CardMoneyAdd (Convert.ToInt32(textBox18.Text));
          if (axPOS011.OperatingResults == 0 )
            {    axPOS011.PcdBeep(38);
    textBox1.Text = Convert.ToString(axPOS011.CardUnit);
    textBox2.Text = Convert.ToString(axPOS011.CardClass);
    textBox3.Text = Convert.ToString(axPOS011.CardCustomNumberStr);
    textBox4.Text = Convert.ToString(axPOS011.CardRechargeTimes);
    textBox5.Text =Convert.ToString(axPOS011.CardHolderPwdStr);
    textBox6.Text = Convert.ToString(axPOS011.CardHolderName);
    textBox7.Text = Convert.ToString(axPOS011.CardMoney);
    textBox8.Text = Convert.ToString(axPOS011.CardLastYear);
    textBox9.Text = Convert.ToString(axPOS011.CardLastMonth);
    textBox10.Text =Convert.ToString(axPOS011.CardLastDay);
    textBox11.Text =Convert.ToString(axPOS011.CardLastMealType);
    textBox12.Text = Convert.ToString(axPOS011.CardLastMealMoney);
    textBox13.Text = Convert.ToString(axPOS011.CardLastDayMoney);
    textBox15.Text = Convert.ToString(axPOS011.CardLastDayNeedPwdMoney);

        
    MessageBox.Show( "充值成功!");


   }
        else  if (axPOS011.OperatingResults == 62)
       {
     textBox1.Text = Convert.ToString(axPOS011.CardUnit);
     textBox2.Text = Convert.ToString(axPOS011.CardClass);
     textBox3.Text = Convert.ToString(axPOS011.CardCustomNumberStr);
     textBox4.Text = Convert.ToString(axPOS011.CardRechargeTimes);
     textBox5.Text =Convert.ToString(axPOS011.CardHolderPwdStr);
     textBox6.Text = Convert.ToString(axPOS011.CardHolderName);
     textBox7.Text = Convert.ToString(axPOS011.CardMoney);
     textBox8.Text = Convert.ToString(axPOS011.CardLastYear);
     textBox9.Text = Convert.ToString(axPOS011.CardLastMonth);
     textBox10.Text =Convert.ToString(axPOS011.CardLastDay);
     textBox11.Text =Convert.ToString(axPOS011.CardLastMealType);
     textBox12.Text = Convert.ToString(axPOS011.CardLastMealMoney);
     textBox13.Text = Convert.ToString(axPOS011.CardLastDayMoney);
     textBox15.Text = Convert.ToString(axPOS011.CardLastDayNeedPwdMoney);

       
    MessageBox.Show ( "充值失败,原因是如果充值金额将溢出!");
     }
        else
      {
   
   MessageBox.Show( Convert.ToString(axPOS011.OperatingResults));

      }
  }

  private void button5_Click(object sender, System.EventArgs e)
  {
     axPOS011.CardAreaNumber = 8 ;     //区号
              axPOS011.CardKeyHexStr = "888888888888"  ;    //密码
              axPOS011.CardMoneySub (Convert.ToInt32(textBox17.Text));
              if (axPOS011.OperatingResults == 0 )
     {
      axPOS011.PcdBeep(38);
      textBox1.Text = Convert.ToString(axPOS011.CardUnit);
      textBox2.Text = Convert.ToString(axPOS011.CardClass);
      textBox3.Text = Convert.ToString(axPOS011.CardCustomNumberStr);
      textBox4.Text = Convert.ToString(axPOS011.CardRechargeTimes);
      textBox5.Text =Convert.ToString(axPOS011.CardHolderPwdStr);
      textBox6.Text = Convert.ToString(axPOS011.CardHolderName);
      textBox7.Text = Convert.ToString(axPOS011.CardMoney);
      textBox8.Text = Convert.ToString(axPOS011.CardLastYear);
      textBox9.Text = Convert.ToString(axPOS011.CardLastMonth);
      textBox10.Text =Convert.ToString(axPOS011.CardLastDay);
      textBox11.Text =Convert.ToString(axPOS011.CardLastMealType);
      textBox12.Text = Convert.ToString(axPOS011.CardLastMealMoney);
      textBox13.Text = Convert.ToString(axPOS011.CardLastDayMoney);
      textBox15.Text = Convert.ToString(axPOS011.CardLastDayNeedPwdMoney);

       
       MessageBox.Show ( "退费成功!");
      }
            else  if (axPOS011.OperatingResults == 61)
       {
     textBox1.Text = Convert.ToString(axPOS011.CardUnit);
        textBox2.Text = Convert.ToString(axPOS011.CardClass);
        textBox3.Text = Convert.ToString(axPOS011.CardCustomNumberStr);
        textBox4.Text = Convert.ToString(axPOS011.CardRechargeTimes);
        textBox5.Text =Convert.ToString(axPOS011.CardHolderPwdStr);
        textBox6.Text = Convert.ToString(axPOS011.CardHolderName);
        textBox7.Text = Convert.ToString(axPOS011.CardMoney);
        textBox8.Text = Convert.ToString(axPOS011.CardLastYear);
        textBox9.Text = Convert.ToString(axPOS011.CardLastMonth);
        textBox10.Text =Convert.ToString(axPOS011.CardLastDay);
        textBox11.Text =Convert.ToString(axPOS011.CardLastMealType);
        textBox12.Text = Convert.ToString(axPOS011.CardLastMealMoney);
        textBox13.Text = Convert.ToString(axPOS011.CardLastDayMoney);
        textBox15.Text = Convert.ToString(axPOS011.CardLastDayNeedPwdMoney);

       
         MessageBox.Show("退费失败,原因是金额不足以退费!");
       }
             else
     {
   
      MessageBox.Show( Convert.ToString(axPOS011.OperatingResults));
     }
  }

  private void button6_Click(object sender, System.EventArgs e)
  {
   axPOS011.CardAreaNumber = 8 ;  //区号
   axPOS011.CardNewKeyAHexStr = "FFFFFFFFFFFF" ;  //新A密码,消费机用A密码
   
   axPOS011.CardAdminLockEn = 0 ; //提示:为0不锁定,为1表示POS机刷密码卡更改后锁定该密码,不能再次更改了
   axPOS011.CardAdminSet();
       
   if (axPOS011.OperatingResults == 0)
   {
    axPOS011.PcdBeep(38);
    MessageBox.Show( "制作密码卡成功,请拿到POS机上刷卡设定!");
   }
   else if( axPOS011.OperatingResults == 8 )
      
   {
    MessageBox.Show("寻不到卡!");

   }
   else if (axPOS011.OperatingResults == 23)
   {
    MessageBox.Show("读写器没插上或驱动程序没安装!");
   }
   else

   {
        
    MessageBox.Show( Convert.ToString(axPOS011.OperatingResults));

   }
  }

  private void button7_Click(object sender, System.EventArgs e)
   {  axPOS011.CardAdminClear();
      
    if( axPOS011.OperatingResults == 0 )
     {
      axPOS011.PcdBeep(38);
      MessageBox.Show ("清空密码卡成功!");
     }
           
    else if( axPOS011.OperatingResults == 8)
     {  
      MessageBox.Show( "寻不到卡!") ;
     }


    else if( axPOS011.OperatingResults == 23 )
     {
      MessageBox.Show ("读写器没插上或驱动程序没安装!");
     }
    else
     {
          
      MessageBox.Show( Convert.ToString(axPOS011.OperatingResults));

     }

 
       }

  private void button8_Click(object sender, System.EventArgs e)
  {

    axPOS011.CardAreaNumber = 8  ;     //区号
    axPOS011.CardHaltEn = 1    ;               //初始化后休眠该卡,之后必须拿开卡再放回感应区卡才能做其他操作
       
    axPOS011.CardNewKeyAHexStr = "FFFFFFFFFFFF"  ;          //'新A密码,消费机用A密码
       
    axPOS011.CardNewKeyBHexStr = "888888888888"  ;              //'新B密码,管理软件用B密码
       
    axPOS011.CardInit();
    if (axPOS011.OperatingResults == 0 )
     {
      axPOS011.PcdBeep(38);
         MessageBox.Show( "卡片初始化成消费卡成功!");
           }
    else  if( axPOS011.OperatingResults == 8)
      {

      MessageBox.Show( "寻不到卡!");
      }
    else
     {
          
      MessageBox.Show( Convert.ToString(axPOS011.OperatingResults));

     }

  }

  private void button10_Click(object sender, System.EventArgs e)
  {
   if (button10.Text  == "打开端口" )
    {
             
//     axPOS011.DevBroadCastMode = 0 ;   485通讯
     axPOS011.DevComPort =Convert.ToInt16(comboBox1.Text.Substring(3,comboBox1.Text.Length- 3));     //提取端口号
     axPOS011.DevComPortOpen = 1;
     if( axPOS011.DevComPortOpen == 1)
     {
           
      button10.Text  = "关闭端口";
     }
    }
   else
    {
     axPOS011.DevComPortOpen = 0;
     button10.Text  = "打开端口";

    }
   
  }

  private void button11_Click(object sender, System.EventArgs e)
  {
   if(axPOS011.DevComPortOpen == 1)
   {
    axPOS011.DevNumber =Convert.ToInt32(textBox16.Text);
    axPOS011.DevStateRead();
     
    if( axPOS011.OperatingResults == 0)
    {
     if( axPOS011.DevStateRecNew > 0 )        // 有新记录
     {checkBox1.Checked=true;}
     else
     {checkBox1.Checked  =false;}
     
              
     if (axPOS011.DevStateRecOver > 0 )    //记录满
     {checkBox2.Checked = true;}
     else
     {checkBox2.Checked =false;}
       
               
     if( axPOS011.DevStateTimer > 0 )         //时间乱
     {checkBox3.Checked = true;}
     else
     {checkBox3.Checked  =false;}
       
               
     if (axPOS011.DevStateLinkEncrypt > 0 )       //设备配置了加密方式
     {checkBox4.Checked = true;}
     else
     {checkBox4.Checked  =false;}
       
              
     textBox25.Text = Convert.ToString(axPOS011.DevLossTotal);         //被挂失卡号数量
     }
          
    else
       
    {
     MessageBox.Show ( "设备通讯不通!");
    }
    
   } 
   else
    {
     MessageBox.Show( "端口未打开!");
    }
   
  }

  private void button12_Click(object sender, System.EventArgs e)
  {       DateTime now=DateTime.Now ;
       int y=Convert.ToInt16(now.Year.ToString())-2000;
    textBox19.Text  =y.ToString();
    textBox20.Text  =now.Month.ToString();
    textBox21.Text  =now.Day.ToString() ;
    textBox22.Text  =now.Hour.ToString()  ;
    textBox23.Text  =now.Minute.ToString() ;
    textBox24.Text  =now.Second.ToString()  ;
             
  }

  private void button13_Click(object sender, System.EventArgs e)
  {
  
   if (axPOS011.DevComPortOpen == 1)
   {
     axPOS011.DevNumber = Convert.ToInt32(textBox16.Text);
     axPOS011.DevTimeRead();
             
     if (axPOS011.OperatingResults == 0 )
     {
      textBox19.Text =Convert.ToString(axPOS011.DevTimeYear);
      textBox19.Text =Convert.ToString(axPOS011.DevTimeMonth);
      textBox19.Text =Convert.ToString(axPOS011.DevTimeDay);
      textBox19.Text =Convert.ToString(axPOS011.DevTimeHour);
      textBox19.Text =Convert.ToString(axPOS011.DevTimeMinute);
      textBox19.Text =Convert.ToString(axPOS011.DevTimeSecond);
       
     }
     else if (axPOS011.OperatingResults == 101)
     {
      MessageBox.Show ("机号不能为零!");
     }
     else
     {
      MessageBox.Show ("设备通讯不通!");
     }
     }
   else
    {
     MessageBox.Show ("端口未打开!");
    }

 


  }

  private void button14_Click(object sender, System.EventArgs e)
  {
  

   if (axPOS011.DevComPortOpen == 1)
    {
        
     axPOS011.DevNumber = Convert.ToInt32(textBox16.Text);
     axPOS011.DevTimeYear = Convert.ToInt16(textBox19.Text);
     axPOS011.DevTimeMonth = Convert.ToInt16( textBox20.Text);
     axPOS011.DevTimeDay = Convert.ToInt16(textBox21.Text);
     axPOS011.DevTimeHour = Convert.ToInt16 (textBox22.Text);
     axPOS011.DevTimeMinute = Convert.ToInt16(textBox23.Text);
     axPOS011.DevTimeSecond = Convert.ToInt16( textBox24.Text);

     axPOS011.DevTimeWrite();
            
     if (axPOS011.OperatingResults == 0)
      {
       MessageBox.Show("时间设定成功!");
      }
     else
      {
       MessageBox.Show("设备通讯不通!");
      }
    }
   else
    {
     MessageBox.Show( "端口未打开!");
    }


  }

  private void button15_Click(object sender, System.EventArgs e)
  {
   Form2 f2=new Form2();
   f2.Owner = this;   f2.Show();
  }

  private void button16_Click(object sender, System.EventArgs e)
  {
   Form3 f3=new Form3();
   f3.Owner=this;
   f3.Show();
  }

  private void button17_Click(object sender, System.EventArgs e)
  {
   Form4 f4=new Form4();
   f4.Owner=this;
   f4.Show();
  }

  private void Form1_Load(object sender, System.EventArgs e)
  {
  
  }

  private void button18_Click(object sender, System.EventArgs e)
  {
   axPOS011.DevIpAddrStr =textBox26.Text;

   axPOS011.DevPing();
    
   if (axPOS011.OperatingResults == 0 )

   {
    MessageBox.Show( axPOS011.DevIpAddrStr + ",Ping成功!");
   }
   else
   {
    MessageBox.Show(axPOS011.DevIpAddrStr + ",错误代码:" +Convert.ToString(axPOS011.OperatingResults));
     
           }
  }

  private void button19_Click(object sender, System.EventArgs e)
  {
   axPOS011.PcReadIpAddrAndMac();
   textBox27.Text = axPOS011.PcIpAddrStr;
   textBox28.Text = axPOS011.PcMacStr;
  }

  private void button21_Click(object sender, System.EventArgs e)
  {
   listView1.Items.Clear();
  }

  private void button20_Click(object sender, System.EventArgs e)
  {
   
      ListViewItem plist;
   long i ;

   axPOS011.DevSearch();
     
   label34.Text="正在搜寻,请稍候.........";
     
  
   if (axPOS011.DevBufferTotal > 0)
   {
    
    listView1.Items.Clear();
         
    for (i = 0 ;i< axPOS011.DevBufferTotal ;i++)
    {
         
     axPOS011.DevBufferPoint = 0;
             
      plist =new ListViewItem( axPOS011.DevBufferIpAddrStr);
             
     plist.SubItems.Add ( axPOS011.DevBufferMaskStr);
             
     plist.SubItems.Add (axPOS011.DevBufferGatewayStr);
            
     plist.SubItems.Add( Convert.ToString (axPOS011.DevBufferPort));
             
     plist.SubItems.Add( axPOS011.DevBufferRemoteAddrStr);
             
     plist.SubItems.Add( axPOS011.DevBufferMacStr);
             
       plist.SubItems.Add( axPOS011.DevBufferNumberDecStr);
         
      }       


     
     
   }

 

 


  }

  private void button22_Click(object sender, System.EventArgs e)
  {
   axPOS011.DevIpAddrStr = textBox29.Text;
   axPOS011.DevMaskStr = textBox30.Text;
   axPOS011.DevGatewayStr = textBox31.Text;
   axPOS011.DevUdpPort = Convert.ToInt32(textBox32.Text);
   axPOS011.DevRemoteAddrStr = textBox33.Text;
   axPOS011.DevSerialDecStr = textBox34.Text;
     
   axPOS011.DevProUdpSet();
     
   if (axPOS011.OperatingResults == 0 )
   {

    MessageBox.Show("修改成功!");
   }
   else if (axPOS011.OperatingResults == 3 )
   {

    MessageBox.Show("接收超时,请检查模块是否联网或模块硬件号输入不对!");
   }
   else
   {
    MessageBox.Show( "错误代码:" + Convert.ToString(axPOS011.OperatingResults));
     
   }
  }

  private void button23_Click(object sender, System.EventArgs e)
  {
   if (checkBox5.Checked==true  )
    {
     axPOS011.DevMaskChgEn = 1;
     axPOS011.DevMaskStr = textBox35.Text;
    }
   else
    {
     axPOS011.DevMaskChgEn = 0;
    }
   
     
   if (checkBox6.Checked==true)
    {
     axPOS011.DevGatewayChgEn = 1;
     axPOS011.DevGatewayStr = textBox36.Text;
    }
   else
    {
     axPOS011.DevGatewayChgEn = 0;
    }
  
     
   if (checkBox7.Checked==true)
    {
     axPOS011.DevUdpPortChgEn = 1;
     axPOS011.DevUdpPort = Convert.ToInt32(textBox37.Text);
    }
   else
    {
     axPOS011.DevUdpPortChgEn = 0;
    }
   
     
   if (checkBox8.Checked==true)
    {
     axPOS011.DevRemoteAddrChgEn = 1;
     axPOS011.DevRemoteAddrStr = textBox38.Text;
    }
   else
    {
     axPOS011.DevRemoteAddrChgEn = 0;
    }
    
     
   axPOS011.DevProUdpSetAll();
     
   if (axPOS011.OperatingResults == 0 )
    {

     MessageBox.Show( "修改成功!");
    }
   else if( axPOS011.OperatingResults == 140 )
    {

     MessageBox.Show( "没有需有修改的选项!");
    }
   else
    {
     MessageBox.Show( "错误代码:" + Convert.ToString(axPOS011.OperatingResults));
     
        }

 

  }

  
  
 }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值