Click here to Skip to main content
11,927,190 members (49,402 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#3.0 C# Networking Network TCP/IP , +
i wanna send one file through ip address i got error like this
No connection could be made because the target machine actively refused it

Below coding i written in this program....this is program error or it's related to firewall proble....but in my system i disable the firewall...

pls help me....

private void btnProcess1_Click(object sender, EventArgs e)
            //----------------> Request to Central Server <----------------
           // TcpClient tc1 = new TcpClient();
            TcpClient tc1 = new TcpClient(txtGroupA.Text, 80);
            NetworkStream ns1 = tc1.GetStream();
            BinaryFormatter bf1 = new BinaryFormatter();
            bf1.Serialize(ns1, "Send Particulars of MultigroupA");
            TcpListener listen;
            Socket sk;
            listen = new TcpListener(8000);
            sk = listen.AcceptSocket();
            NetworkStream ns = new NetworkStream(sk);
            BinaryFormatter bf = new BinaryFormatter();
            object op;
            op = bf.Deserialize(ns);
            string returndata1 = op.ToString();
            char[] spiltch1 = { ' ' };
            string[] spit1 = null;
            spit1 = returndata1.Split(spiltch1);
            a11 = spit1[0].ToString();
            b1 = spit1[1].ToString();
            c1 = spit1[2].ToString();
            d1 = spit1[3].ToString();
            e1 = spit1[4].ToString();
            f1 = spit1[5].ToString();
            g1 = spit1[6].ToString();
            h1 = spit1[7].ToString();
            i1 = spit1[8].ToString();
            j1 = spit1[9].ToString();
            txtResTime1.Text = d1.ToString();
            txtPathA.Text = e1.ToString();
            txtResB.Text = i1.ToString();
            txtPathB.Text = j1.ToString();


"I got error in that highlighted line"
Posted 3-Dec-12 22:56pm
Richard MacCutchan 4-Dec-12 4:05am
Do you have an application that is listening on port 80 at that IP address?
Deenu India 4-Dec-12 4:10am
nope sir....this is my friend project.... he write port is 6060 but i changed to 80.... but again i'm getting the same error only....
Mendor81 4-Dec-12 11:14am
Probably because the 80 is a default port try use another port.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 4 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100