日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > C# >内容正文

C#

POS消费机C#例子代码

發布時間:2024/4/11 C# 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 POS消费机C#例子代码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

詳細代碼

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

namespace POS機C井例子代碼
{
?/// <summary>
?/// Form3 的摘要說明。
?/// </summary>
?public class Form3 : System.Windows.Forms.Form
?{
? private System.Windows.Forms.Label label1;
? private System.Windows.Forms.Label label2;
? private System.Windows.Forms.Label label3;
? private System.Windows.Forms.TextBox textBox1;
? private System.Windows.Forms.ProgressBar progressBar1;
? private System.Windows.Forms.Button button1;
? private System.Windows.Forms.Button button2;
? 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.ListView listView1;
? private Microsoft.VisualBasic.Compatibility.VB6.DriveListBox driveListBox1;
? private System.Windows.Forms.TextBox textBox2;
? /// <summary>
? /// 必需的設計器變量。
? /// </summary>
? private System.ComponentModel.Container components = null;

? public Form3()
? {
?? //
?? // 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()
? {
?? this.label1 = new System.Windows.Forms.Label();
?? this.label2 = new System.Windows.Forms.Label();
?? this.label3 = new System.Windows.Forms.Label();
?? this.textBox1 = new System.Windows.Forms.TextBox();
?? this.progressBar1 = new System.Windows.Forms.ProgressBar();
?? this.button1 = new System.Windows.Forms.Button();
?? this.button2 = new System.Windows.Forms.Button();
?? this.button3 = new System.Windows.Forms.Button();
?? this.button4 = new System.Windows.Forms.Button();
?? this.button5 = new System.Windows.Forms.Button();
?? this.button6 = new System.Windows.Forms.Button();
?? this.button7 = new System.Windows.Forms.Button();
?? this.button8 = new System.Windows.Forms.Button();
?? this.button9 = new System.Windows.Forms.Button();
?? this.listView1 = new System.Windows.Forms.ListView();
?? this.driveListBox1 = new Microsoft.VisualBasic.Compatibility.VB6.DriveListBox();
?? this.textBox2 = new System.Windows.Forms.TextBox();
?? this.SuspendLayout();
?? //
?? // label1
?? //
?? this.label1.Location = new System.Drawing.Point(24, 24);
?? this.label1.Name = "label1";
?? this.label1.Size = new System.Drawing.Size(64, 23);
?? this.label1.TabIndex = 0;
?? this.label1.Text = "掛失管理";
?? //
?? // label2
?? //
?? this.label2.Location = new System.Drawing.Point(112, 24);
?? this.label2.Name = "label2";
?? this.label2.Size = new System.Drawing.Size(64, 23);
?? this.label2.TabIndex = 1;
?? this.label2.Text = "總掛失數";
?? //
?? // label3
?? //
?? this.label3.Location = new System.Drawing.Point(112, 352);
?? this.label3.Name = "label3";
?? this.label3.Size = new System.Drawing.Size(32, 23);
?? this.label3.TabIndex = 2;
?? this.label3.Text = "卡號";
?? //
?? // textBox1
?? //
?? this.textBox1.Location = new System.Drawing.Point(184, 24);
?? this.textBox1.Name = "textBox1";
?? this.textBox1.TabIndex = 3;
?? this.textBox1.Text = "0";
?? //
?? // progressBar1
?? //
?? this.progressBar1.Location = new System.Drawing.Point(488, 24);
?? this.progressBar1.Maximum = 10000;
?? this.progressBar1.Name = "progressBar1";
?? this.progressBar1.Size = new System.Drawing.Size(136, 23);
?? this.progressBar1.TabIndex = 4;
?? //
?? // button1
?? //
?? this.button1.Location = new System.Drawing.Point(16, 72);
?? this.button1.Name = "button1";
?? this.button1.Size = new System.Drawing.Size(80, 32);
?? this.button1.TabIndex = 5;
?? this.button1.Text = "增加掛失";
?? this.button1.Click += new System.EventHandler(this.button1_Click);
?? //
?? // button2
?? //
?? this.button2.Location = new System.Drawing.Point(16, 120);
?? this.button2.Name = "button2";
?? this.button2.Size = new System.Drawing.Size(80, 32);
?? this.button2.TabIndex = 6;
?? this.button2.Text = "清 空";
?? this.button2.Click += new System.EventHandler(this.button2_Click);
?? //
?? // button3
?? //
?? this.button3.Location = new System.Drawing.Point(568, 72);
?? this.button3.Name = "button3";
?? this.button3.Size = new System.Drawing.Size(144, 48);
?? this.button3.TabIndex = 7;
?? this.button3.Text = "覆蓋式發送左邊列表中所有掛失卡號至設備";
?? this.button3.Click += new System.EventHandler(this.button3_Click);
?? //
?? // button4
?? //
?? this.button4.Location = new System.Drawing.Point(568, 144);
?? this.button4.Name = "button4";
?? this.button4.Size = new System.Drawing.Size(144, 48);
?? this.button4.TabIndex = 8;
?? this.button4.Text = "<<從設備中讀取所有掛失信息";
?? this.button4.Click += new System.EventHandler(this.button4_Click);
?? //
?? // button5
?? //
?? this.button5.Location = new System.Drawing.Point(568, 224);
?? this.button5.Name = "button5";
?? this.button5.Size = new System.Drawing.Size(48, 32);
?? this.button5.TabIndex = 9;
?? this.button5.Text = "刷新";
?? this.button5.Click += new System.EventHandler(this.button5_Click);
?? //
?? // button6
?? //
?? this.button6.Location = new System.Drawing.Point(568, 280);
?? this.button6.Name = "button6";
?? this.button6.Size = new System.Drawing.Size(144, 48);
?? this.button6.TabIndex = 10;
?? this.button6.Text = "寫所有掛失信息至U盤或磁盤";
?? this.button6.Click += new System.EventHandler(this.button6_Click);
?? //
?? // button7
?? //
?? this.button7.Location = new System.Drawing.Point(224, 352);
?? this.button7.Name = "button7";
?? this.button7.Size = new System.Drawing.Size(136, 48);
?? this.button7.TabIndex = 11;
?? this.button7.Text = "追加式從設備取消單個卡號掛失";
?? this.button7.Click += new System.EventHandler(this.button7_Click);
?? //
?? // button8
?? //
?? this.button8.Location = new System.Drawing.Point(392, 352);
?? this.button8.Name = "button8";
?? this.button8.Size = new System.Drawing.Size(144, 48);
?? this.button8.TabIndex = 12;
?? this.button8.Text = "追加式掛失單個卡號至設備";
?? this.button8.Click += new System.EventHandler(this.button8_Click);
?? //
?? // button9
?? //
?? this.button9.Location = new System.Drawing.Point(568, 352);
?? this.button9.Name = "button9";
?? this.button9.Size = new System.Drawing.Size(144, 48);
?? this.button9.TabIndex = 13;
?? this.button9.Text = "從設備中查詢卡號是否已被掛失";
?? this.button9.Click += new System.EventHandler(this.button9_Click);
?? //
?? // listView1
?? //
?? this.listView1.Location = new System.Drawing.Point(112, 72);
?? this.listView1.Name = "listView1";
?? this.listView1.Size = new System.Drawing.Size(440, 256);
?? this.listView1.TabIndex = 14;
?? this.listView1.View = System.Windows.Forms.View.List;
?? //
?? // driveListBox1
?? //
?? this.driveListBox1.Location = new System.Drawing.Point(624, 224);
?? this.driveListBox1.Name = "driveListBox1";
?? this.driveListBox1.Size = new System.Drawing.Size(88, 22);
?? this.driveListBox1.TabIndex = 15;
?? //
?? // textBox2
?? //
?? this.textBox2.Location = new System.Drawing.Point(152, 352);
?? this.textBox2.Name = "textBox2";
?? this.textBox2.Size = new System.Drawing.Size(56, 21);
?? this.textBox2.TabIndex = 16;
?? this.textBox2.Text = "12";
?? //
?? // Form3
?? //
?? this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
?? this.ClientSize = new System.Drawing.Size(752, 422);
?? this.Controls.Add(this.textBox2);
?? this.Controls.Add(this.driveListBox1);
?? this.Controls.Add(this.listView1);
?? this.Controls.Add(this.button9);
?? this.Controls.Add(this.button8);
?? this.Controls.Add(this.button7);
?? this.Controls.Add(this.button6);
?? this.Controls.Add(this.button5);
?? this.Controls.Add(this.button4);
?? this.Controls.Add(this.button3);
?? this.Controls.Add(this.button2);
?? this.Controls.Add(this.button1);
?? this.Controls.Add(this.progressBar1);
?? this.Controls.Add(this.textBox1);
?? this.Controls.Add(this.label3);
?? this.Controls.Add(this.label2);
?? this.Controls.Add(this.label1);
?? this.Name = "Form3";
?? this.Text = "Form3";
?? this.ResumeLayout(false);

? }
? #endregion

?

? private void button1_Click(object sender, System.EventArgs e)
? {
?? Form5 f5=new Form5();
??
?? f5.ShowDialog();

?? String? str;

?? str = f5.Value;???????????????????????????????? //InputBox("請輸入卡號,必須為小于65535的數字", 輸入卡號);
?? this.listView1.Items.Add(str);
? }

? private void button2_Click(object sender, System.EventArgs e)
? {
??
?? this.listView1.Clear ();
? }

? private void button3_Click(object sender, System.EventArgs e)
? {
?? int i;
?? Form1 f3 ;
?? f3 = (Form1)this.Owner;
?? f3.Refresh();
??????
?? if( f3.axPOS011.DevComPortOpen == 1)
?? {
??? f3.axPOS011.DevLossClearFromBuf();????????? // 先清空緩沖
????????
??? for (i = 0;i<listView1.Items.Count ;i++)
??? {
????
???? f3.axPOS011.CardCustomNumberStr = listView1.Items[i].Text;
???? f3.axPOS011.DevLossAddToBuf();?????????? //加入掛失信息緩沖
??? }

??? f3.axPOS011.DevNumber = Convert.ToInt32(f3.textBox16.Text);
??? this.progressBar1.Maximum = f3.axPOS011.DevLossFrames;
??? this.progressBar1.Value = 0;
?????
????????????
??? for( i = 0 ;i<=f3.axPOS011.DevLossFrames - 1;i++)
??? {
???? f3.axPOS011.DevLossFramePoint = i;
???? f3.axPOS011.DevLossFrameWrite();
???? if( f3.axPOS011.OperatingResults != 0)
?????????
???? {break;}
???? else
???? {
????? this.progressBar1.Value = i + 1;
???????????
???? }

??? }
????????????
??? if (f3.axPOS011.OperatingResults == 0 )

??? {
???? MessageBox.Show ( "下載掛失信息成功!");
??? }
??? else
??? {
???? MessageBox.Show(Convert.ToString (f3.axPOS011.OperatingResults));
??? }
?? }
?? else
?? {
??? MessageBox.Show( "端口未打開!");

?? }
? }


? private void button4_Click(object sender, System.EventArgs e)
? {
?? Form1 f3 ;
?? f3 = (Form1)this.Owner;
?? f3.Refresh();
?? int i;
?? if (f3.axPOS011.DevComPortOpen == 1 )
?? {
??? f3.axPOS011.DevNumber = Convert.ToInt32(f3.textBox16.Text );
??? this.progressBar1.Maximum=f3.axPOS011.DevLossFrames;
??? this.progressBar1.Value =0;?????
???????????
??? for (i = 0 ;i<f3.axPOS011.DevLossFrames ;i++)
??? {
???? f3.axPOS011.DevLossFramePoint = i;
???? f3.axPOS011.DevLossFrameRead();
???? if (f3.axPOS011.OperatingResults != 0 )
???? {
????? break;
???? }
???? else
???? {
????? this.progressBar1.Value=i+1;
???? }
??? }
???????????
??? if (f3.axPOS011.OperatingResults == 0)
??? {
???? if (f3.axPOS011.DevLossBufSize > 0)
???? {
????? for (i = 0;i<f3.axPOS011.DevLossBufSize ;i++)?????????????????????
????? {
?????? f3.axPOS011.DevLossBufPoint = i;??????????????????????????
?????? listView1.Items.Add( f3.axPOS011.CardCustomNumberStr);
???????????????????????
????? }?????
????? MessageBox.Show ( "提取掛失信息成功!");
???? }
??? }
???????????????????????????
??? else
??? {
???? MessageBox.Show( Convert.ToString (f3.axPOS011.OperatingResults));

??? }
???
???? }
?? else
?? {
??? MessageBox.Show( "端口未打開!");
?? }
??
? }

? private void button5_Click(object sender, System.EventArgs e)
? {
?? this.driveListBox1.Refresh();
? }

? private void button6_Click(object sender, System.EventArgs e)
? {
?? Form1 f3 ;
?? f3 = (Form1)this.Owner;
?? f3.Refresh();
????? int i;

?? f3.axPOS011.DevLossClearFromBuf();????? //先清空緩沖
????????
?? for (i = 0;i<listView1.Items.Count ;i++)
?? {
???
??? f3.axPOS011.CardCustomNumberStr = listView1.Items[i].Text;
??? f3.axPOS011.DevLossAddToBuf();?????????? //加入掛失信息緩沖
?? }
????????
?? f3.axPOS011.DevDriverStr =this.driveListBox1.Drive;
????????
?? f3.axPOS011.DevLossWriteAllToDisk();
????????
????????
?? if (f3.axPOS011.OperatingResults == 0 )
?? {
??? MessageBox.Show ( "寫覆蓋式掛失信息到U盤或磁盤成功!");
?? }
?? else
?? {
??? MessageBox.Show(Convert.ToString ( f3.axPOS011.OperatingResults));
?? }
?

? }

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

?? Form1 f3 ;
?? f3 = (Form1)this.Owner;
?? f3.Refresh();

?? if( f3.axPOS011.DevComPortOpen == 1)
?? {
??? f3.axPOS011.DevNumber = Convert.ToInt32(f3.textBox16.Text );
??? f3.axPOS011.CardCustomNumberStr = textBox2.Text ;??????? //自編卡號
??? f3.axPOS011.DevLossBitRead();

??? if( f3.axPOS011.OperatingResults == 0 )
??? {
???? MessageBox.Show ( "該卡號已被掛失!");
??? }
????????????
??? else if (f3.axPOS011.OperatingResults == 113 )
??? {
???? MessageBox.Show ( "該卡號可使用!");
??? }
??? else
??? {
???? MessageBox.Show ( "設備通訊不通!");
??? }
?? }
?? else
?? {
??? MessageBox.Show? ("端口未打開!");
?? }
?
? }

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

?? Form1 f3 ;
?? f3 = (Form1)this.Owner;
?? f3.Refresh();
?
?? if (f3.axPOS011.DevComPortOpen == 1 )
?? {
??? f3.axPOS011.DevNumber = Convert.ToInt32(f3.textBox16.Text );
??? f3.axPOS011.CardCustomNumberStr = textBox1.Text ;????????? //自編卡號
??? f3.axPOS011.DevLossBitWrite();
???????????
???????????
??? if (f3.axPOS011.OperatingResults == 0 )
??? {
???? MessageBox.Show ( "掛失單張卡號成功!");
??? }
????
???????????
??? else
??? {
???? MessageBox.Show("設備通訊不通!");
??? }
?? }
?? else
??? {
???? MessageBox.Show( "端口未打開!");
??? }

? }

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

?? Form1 f3 ;
?? f3 = (Form1)this.Owner;
?? f3.Refresh();
?
?? if (f3.axPOS011.DevComPortOpen == 1)
??? {
???? f3.axPOS011.DevNumber = Convert.ToInt32(f3.textBox16.Text );? //指定設備號
???? f3.axPOS011.CardCustomNumberStr = textBox2.Text? ;??????????? //自編卡號
???? f3.axPOS011.DevLossBitClear();??????????????????????????????? //在設備中清空該卡號的掛失信息

???? if( f3.axPOS011.OperatingResults == 0 )??????????????????????
????? {
?????? MessageBox.Show ("取消單張卡號成功!");
??????
????? }
???? else
????? {
?????? MessageBox.Show( "設備通訊不通!");
????? }
??? }
???? else
??? {
???? MessageBox.Show ("端口未打開!");
??? }
????

? }
?}
}


?

轉載于:https://blog.51cto.com/reader/597062

總結

以上是生活随笔為你收集整理的POS消费机C#例子代码的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 丰满岳乱妇国产精品一区 | 成人在线日韩 | 婷婷综合五月 | 成年精品 | 日韩少妇精品 | 日日日日日日bbbbbb | 神马午夜91 | 国产精品传媒在线观看 | 99久久婷婷国产综合精品青牛牛 | 精品人妻一区二区三区香蕉 | 国产亚洲一区二区三区不卡 | 国产精品入口久久 | 亚洲免费一区二区 | 超黄网站在线观看 | 国产第一精品视频 | 久久婷色 | 日韩伊人 | 成年人在线观看视频网站 | 玩偶姐姐在线观看免费 | 三级欧美韩日大片在线看 | 黄色操人视频 | 中文字幕手机在线视频 | 精品国产一区在线 | 少妇又色又紧又大爽又刺激 | 黄色一级二级 | 国产黄色三级 | www.久久久久 | 欧美久久久久久久久 | 不卡一二三 | 五十路息子 | 免费看毛片的网站 | 一区二区三区四区久久 | www.99爱| 日本国产一区二区三区 | 国产精品成人久久电影 | 免费看91| 久久久中文 | 欧美群妇大交乱 | 久草久草久草 | 日韩美女黄色片 | 涩涩亚洲 | av大片免费在线观看 | 97色婷婷 | 日本不卡视频在线观看 | 国产在线观看成人 | 亚洲视频免费在线 | 中国免费一级片 | 九一成人网 | 哪里看毛片 | 国产情侣自拍一区 | 性xxx欧美 | 看av网站 | 自拍偷拍2019 | 国产伦视频 | 人妻视频一区二区三区 | julia一区二区三区在线观看 | 97小视频 | 香蕉视频在线看 | 国产男女av | 欧美色图17p | 色呦呦视频 | 精品美女在线观看 | 毛片毛片毛片毛片毛片毛片 | 国模私拍一区二区三区 | 国内免费精品视频 | 亚洲视频一区二区三区在线观看 | 中文字幕免费在线看线人 | 亚洲美女影院 | 精品国产乱码久久久久久88av | 亚洲精品91 | 日本老少交 | 男人午夜免费视频 | 五月开心激情网 | 国产小视频在线观看免费 | 国产三级av片 | 亚洲 小说 欧美 激情 另类 | 麻豆chinese新婚xxx | 黄色av免费在线播放 | 外国黄色网 | 日日骑夜夜操 | 激情六月综合 | 在线欧美亚洲 | www成年人 | 欧美在线视频网站 | 国产色区 | 一色av | 免费看黄色片的网站 | 亚洲一区二区三区在线免费观看 | 吃奶av| 国产中文字幕三区 | 全黄一级裸体 | www日韩欧美 | 91香蕉一区二区三区在线观看 | 亚洲精品无码专区 | 成人99| 欧美xxx性 | 夜夜嗨一区| 精品国产污污免费网站入口 | 另类亚洲色图 |