日韩性视频-久久久蜜桃-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#例子代码的全部內容,希望文章能夠幫你解決所遇到的問題。

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

主站蜘蛛池模板: 少妇喷白浆| 日韩最新视频 | 欧美成人a交片免费看 | 欧美福利网站 | 日韩视频欧美视频 | 嫩模啪啪| 国产一级在线免费观看 | 日本在线视频一区二区三区 | 国产精品一区二区三区免费视频 | 亚洲三级在线视频 | 黑人添美女bbb添高潮了 | 欧美亚洲国产成人 | 久久久久无码国产精品一区李宗瑞 | 新91av| 成人免费毛片高清视频 | 亚洲天堂不卡 | 亚洲第一av网 | 亚洲av无码乱码在线观看性色 | 黄色片视频免费 | 亚洲狠 | 岛国av一区二区 | 日韩精品在线视频免费观看 | 又黄又爽的免费视频 | 无人在线观看高清视频 单曲 | 亚洲视频黄 | 中文字幕一区日韩 | 91精品国产91久久久久久黑人 | 国产美女主播在线观看 | 天天操天天舔天天干 | 欧美日韩国产免费观看 | 日本打白嫩屁股视频 | 成人永久免费视频 | 51精产品一区一区三区 | 欧美肉丝袜videos办公室 | 国产成人无码一区二区三区在线 | 色播视频在线观看 | 天天看毛片 | 一区二区三区四区人妻 | 九九九九色 | 在线观看69| 99久久久久久久久 | 国产不卡一区二区视频 | 在线观看理论片 | 影音先锋蜜桃 | 不卡久久 | 天天操天天干天天爽 | 丰满人妻熟妇乱偷人无码 | 深爱五月激情五月 | 日本乱偷中文字幕 | 7799精品视频天天看 | 97久久免费视频 | 欧美日韩中文字幕一区二区三区 | 亚洲精品免费电影 | 一区二区高清在线 | 色5月婷婷| 精品一区二区三区不卡 | 日韩一区三区 | 第一页综合 | 97人妻精品一区二区三区免 | av黄色国产 | 日本黄页网站免费大全 | 免费在线观看a视频 | 国产精品久久综合 | 色偷偷资源 | 久久精品超碰 | 中国一级免费毛片 | 久操视频网站 | 成人三级在线播放 | 91丝袜呻吟高潮美腿白嫩在线观看 | 一级片免费在线观看 | 葵司免费一区二区三区四区五区 | 亚洲小视频网站 | 看免费黄色大片 | 久草资源福利 | 三级a做爰全过程 | 亚州成人| 尤物网址在线观看 | 91精品人妻一区二区三区四区 | 动漫精品一区一码二码三码四码 | 91不卡视频| 国产伦精品一区二区三区四区 | 国产白丝袜美女久久久久 | 亚洲一区二区三区 | 黄色在线视频网址 | 久久午夜精品 | 大奶在线播放 | 欧美入口| 欧美污视频在线观看 | 欧美精品久久久久性色 | 深夜福利视频在线观看 | 中文字幕精品久久久久人妻红杏ⅰ | 国产伦理片在线观看 | 亚洲欧美日韩精品色xxx | 国产又粗又猛又黄又爽的视频 | 国产在线欧美 | 稀缺呦国内精品呦 | 久久久精品综合 | 日韩欧美色 | av资源免费观看 |