无法建立连接,因为... [英] No connection could be made because...

查看:129
本文介绍了无法建立连接,因为...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生...

我在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.


这篇关于无法建立连接,因为...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆