Click here to Skip to main content
Rate this: bad
good
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 192.168.1.20:80
 
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);
            listen.Start();
            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();
 

            ns.Close();
            sk.Close();
        
}
 
"I got error in that highlighted line"
Posted 3-Dec-12 22:56pm
Deenuji3.8K
Comments
Richard MacCutchan at 4-Dec-12 4:05am
   
Do you have an application that is listening on port 80 at that IP address?
Deenu India at 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 at 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
0 OriginalGriff 290
1 Jochen Arndt 150
2 Kornfeld Eliyahu Peter 149
3 PIEBALDconsult 110
4 Richard MacCutchan 105
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 4 Dec 2012
Copyright © CodeProject, 1999-2014
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