C#.net TCP通讯

hu_xianfeng 49 0 ZIP 2018-12-25 05:12:02

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); }

用户评论
请输入评论内容
评分:
Generic placeholder image 卡了网匿名网友 2018-12-25 05:12:02

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