private void button19_Click(object sender, EventArgs e) { StringBuilder ierrinfo1 = new StringBuilder(2048); StringBuilder cardno = new StringBuilder(20480); StringBuilder ierrinfo = new StringBuilder(20480); int port = IntExtension.Parse(textBox1.Text); int com = 0;//usb=100 int ret = 0; ret = SSCard.iDOpenPort(port, ref com, ierrinfo1); if (ret != 0) { MessageBox.Show("打开端口失败" + ierrinfo1.ToString()); return; } else { ret = SSCard.getCardNO(IntExtension.Parse(textBox1.Text), cardno, ierrinfo); if (ret != 0) { MessageBox.Show("读取卡号失败:" + ierrinfo.ToString()); } else { MessageBox.Show(cardno.ToString()); } } }
private void button1_Click(object sender, EventArgs e) { AppCfg.Instance.Port = IntExtension.Parse(textBoxPort.Text.Trim()); AppCfg.Instance.Save(); if (button1.Text == "开启") { textBoxPort.Enabled = false; button1.Text = "停止"; HostConfiguration hostConfig = new HostConfiguration() { UrlReservations = new UrlReservations() { //create URL reservations automatically CreateAutomatically = true } }; Uri uri = new Uri("http://localhost:" + AppCfg.Instance.Port); nancySelfHost = new NancyHost(hostConfig, uri); nancySelfHost.Start(); AppReportManager.Instance.Send(new LogEntity() { Log = "开启监测" }); } else { nancySelfHost.Stop(); textBoxPort.Enabled = true; button1.Text = "开启"; AppReportManager.Instance.Send(new LogEntity() { Log = "停止监测" }); } }
private void button1_Click(object sender, EventArgs e) { Configs.Handle = dcrf.dc_init(IntExtension.Parse(textBox1.Text), IntExtension.Parse(textBox2.Text)); MessageBox.Show(Configs.Handle.ToString()); }