无法建立连接,因为...

编程入门 行业动态 更新时间:2024-10-26 02:35:38
本文介绍了无法建立连接,因为...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

先生... 我在TCP连接编码中有一个错误,请更正它们.错误是由于目标计算机主动拒绝了它,所以无法建立连接192.168.1.32:8080"

sir... I have one error in tcp connection coding please correct them. the error is "No connection could be made because the target machine actively refused it 192.168.1.32:8080"

string n; byte[] b1; OpenFileDialog ofd = new OpenFileDialog(); private void button1_Click(object sender, EventArgs e) { if (ofd.ShowDialog() == DialogResult.OK) { string t = textBox1.Text; t = ofd.FileName; // textBox2.Text = t; FileInfo fi = new FileInfo(textBox1.Text = ofd.FileName); n = fi.Name + "." + fi.Length; TcpClient client = new TcpClient("192.168.1.32", 5050); StreamWriter sw = new StreamWriter(client.GetStream()); sw.WriteLine(n); sw.Flush(); label1.Text = "File Transferred...."; } }

推荐答案

我们无法真正帮助您解决此问题-通常是因为远程计算机(在运行中)没有任何监听指定的端口,或者运行的防火墙主动阻止了该端口. 我可以建议在此距离之内检查远程计算机的端口号和防火墙! We can''t really help you fix this - it is generally because the remote machine (while up and working) has nothing listening on the specified port, or has a firewall running that actively blocks the port. Check the remote machine port number, and firewall, is all I can suggest at this distance!

1.go进入命令提示符 2.写行ping 192.168.1.32并输入 检查服务器是否响应,以检查您是否能够连接到目标服务器. 1.go to command prompt 2. write line ping 192.168.1.32 and enter check whether response of server to check whether you are able to connect to target server or not.

更多推荐

无法建立连接,因为...

本文发布于:2023-11-15 04:44:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1591260.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!