1. 首页
  2. 编程语言
  3. C#
  4. C#.net TCP通讯

C#.net TCP通讯

上传者: 2018-12-25 05:19:02上传 ZIP文件 154.87KB 热度 50次
try { TcpClient = new TcpClient(txtServerIp.Text, int.Parse(txtPort.Text.Trim())); Stream = TcpClient.GetStream(); ClientReader = new StreamReader(Stream); ClientWriter = new StreamWriter(Stream); txtServerIp.Enabled = false; btnConnect.Enabled = false; this.Text = "客户端 " + "正在与" + txtServerIp.Text.Trim() + "连接……"; return; } catch { txtServerIp.Enabled = true; btnConnect.Enabled = true; this.Text = "连接失败……"; //MessageBox.Show("连接失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); }
用户评论
码姐姐匿名网友 2018-12-25 05:19:02

资源可以,但不是我想要的。