TcpClient tc = new TcpClient();
IPAddress ip = IPAddress.Parse(192.168.1.1);
int notePort = int.Parse(9100);
tc.Connect(ip, notePort);
NetworkStream stream = tc.GetStream();
string a = "BF ON:PP 125,40:BT \"CODE39\":PB \"232323232\":PF";
Byte[] data = Encoding.ASCII.GetBytes(a);
stream.Write(data, data.Length, 0);
stream.Close();
tc.Close();
MessageBox.Show("已发送");
txtData.SelectAll();
txtData.Focus(); 程序能通过,但是发送出去的指令,条码打印机没反应,只是闪了一下灯,是不是我发送的指令错了还是应该用那种方式发送。在此谢过了
IPAddress ip = IPAddress.Parse(192.168.1.1);
int notePort = int.Parse(9100);
tc.Connect(ip, notePort);
NetworkStream stream = tc.GetStream();
string a = "BF ON:PP 125,40:BT \"CODE39\":PB \"232323232\":PF";
Byte[] data = Encoding.ASCII.GetBytes(a);
stream.Write(data, data.Length, 0);
stream.Close();
tc.Close();
MessageBox.Show("已发送");
txtData.SelectAll();
txtData.Focus(); 程序能通过,但是发送出去的指令,条码打印机没反应,只是闪了一下灯,是不是我发送的指令错了还是应该用那种方式发送。在此谢过了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货