private void button1_Click(object sender, EventArgs e) { string EPCNo; int i = 0; if (this.Text == "发卡程序--未找到发卡器") { readers = reader.GetReaderList(); if (readers.Count == 0) { MessageBox.Show("未找到发卡器,请先插好发卡器"); return; } else { reader.Connect(readers[0]); this.Text = "发卡程序--发卡器已连接"; } } button1.Enabled = false; button2.Enabled = true; button3.Enabled = false; faka = true; while (faka) { if (i == Convert.ToInt16(textBox1.Text)) { listView1.Items.RemoveAt(0); i = 0; } ReadEpcResult readresult = reader.ReadEpc(); if (readresult.ReadResult.Result == AccessResult.Success) { EPCNo = readresult.TagAccessed.Epc; if (EPCNo != listView1.Items[0].Text) { ProgramEpcParams pep = new ProgramEpcParams(); pep.NewEpc = listView1.Items[0].Text; pep.AntennaPortNumber = 0; pep.AccessPassword = "00000000"; ProgramEpcResult writeresult = reader.ProgramEpc(pep); if (writeresult.WriteResult.Result == AccessResult.Success) { i = i + 1; richTextBox1.Text = listView1.Items[0].Text + "发卡成功" + "\n"; } } else { richTextBox1.Text = listView1.Items[0].Text + "已发放,请放下一张" + "\n"; } } Thread.Sleep(100); } }
解决方案 »
- 请问如何利用后绑定WORD的方式处理文档中的边框属性
- 数据字典中值的排序
- 100分!HttpWebrequest请求一个存在页面,但是报404错误,太诡异了,有用回答就给分
- 高分求助!短信猫串口编程,8位移动号和普通手机号的区别!
- c# 怎样保存账户名
- 我写的划线方法,怎么窗体创建时不运行呢?
- 饼子们注意了!!! SharePoint 中如何让用户自己修改密码?
- 如何从数据库中读取varbinary类型数据,并把它转换成汉字
- 一本专讲MSIL的书名忘记了,请告诉我好吗?
- lyhold(让你飞)兄、 sungirl_xp(暴力女孩) 、 lby402(lby)进来拿分啦:)
- AspNetPager1.RecordCount
- sql server数据库的问题
2打断点瞧瞧问题在哪里
假如是 不进入到 button1_Click 那么你到当前from的 Designer.cs 文件中去检查下:
this.button1.Click += new System.EventHandler(this.button1_Click);看是不是是这样绑定的....
这个 是不是你搞错了???while会无线循环的 ...你在while中又没有 修改faka;;;