Click here to Skip to main content
15,880,469 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using lock statement inside overloaded methods Pin
Nuno Pacheco22-Oct-09 2:36
Nuno Pacheco22-Oct-09 2:36 
GeneralRe: Using lock statement inside overloaded methods Pin
Covean22-Oct-09 2:53
Covean22-Oct-09 2:53 
Questionhow to create multiple connections in a client application Pin
Ajithevn21-Oct-09 23:36
Ajithevn21-Oct-09 23:36 
QuestionRe: how to create multiple connections in a client application Pin
Björn T.J.M. Spruit22-Oct-09 0:00
Björn T.J.M. Spruit22-Oct-09 0:00 
AnswerRe: how to create multiple connections in a client application Pin
Ajithevn22-Oct-09 0:11
Ajithevn22-Oct-09 0:11 
AnswerRe: how to create multiple connections in a client application Pin
Abhishek Sur22-Oct-09 0:07
professionalAbhishek Sur22-Oct-09 0:07 
GeneralRe: how to create multiple connections in a client application Pin
Ajithevn22-Oct-09 0:17
Ajithevn22-Oct-09 0:17 
QuestionRe: how to create multiple connections in a client application Pin
Ajithevn22-Oct-09 1:04
Ajithevn22-Oct-09 1:04 
i have tried running threads in this format. but this also works only if button is clicked and only for 4 times but
i wish 1 client to connect to the server when button is clicked and other client will connect and close for each minute.
the code is:-

private void button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 4; i++)
            {
                Thread thread = new Thread(new ParameterizedThreadStart(round));
                thread.Start();
                thread.Join();
                Thread.Sleep(100);
            }
        }
 private void round(object val)
        {
            System.Net.IPAddress myIP;
            System.Net.IPEndPoint  myServer;
            Socket socket;
            string ip = (string)val; 

            try
            {
                myIP = System.Net.IPAddress.Parse(ip);
                myServer = new System.Net.IPEndPoint(myIP, Int32.Parse("20000"));
                socket=new Socket(AddressFamily.InterNetwork,SocketType.Stream ,ProtocolType.Tcp);
                socket.Connect(myServer);
                NetworkStream netStream=new NetworkStream(socket);
                Byte[] byteMessage=new Byte[640];
                string sendMessage="hello server";
                byteMessage=System.Text.Encoding.Default.GetBytes( sendMessage.ToCharArray());
                netStream.Write(byteMessage,0,byteMessage.Length);
                netStream.Flush();
                netStream.Close();
                socket.Close();
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }

QuestionText blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit21-Oct-09 23:04
Björn T.J.M. Spruit21-Oct-09 23:04 
AnswerRe: Text blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit22-Oct-09 1:54
Björn T.J.M. Spruit22-Oct-09 1:54 
GeneralRe: Text blurring using Graphics.Drawstring Pin
Covean22-Oct-09 2:15
Covean22-Oct-09 2:15 
GeneralRe: Text blurring using Graphics.Drawstring [modified] Pin
Björn T.J.M. Spruit22-Oct-09 2:54
Björn T.J.M. Spruit22-Oct-09 2:54 
GeneralRe: Text blurring using Graphics.Drawstring Pin
Covean22-Oct-09 3:18
Covean22-Oct-09 3:18 
GeneralRe: Text blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit22-Oct-09 3:27
Björn T.J.M. Spruit22-Oct-09 3:27 
NewsRe: Text blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit30-Oct-09 4:25
Björn T.J.M. Spruit30-Oct-09 4:25 
GeneralRe: Text blurring using Graphics.Drawstring Pin
User 680178026-Feb-10 8:05
User 680178026-Feb-10 8:05 
QuestionHow to pass any text value from form to Crystal Report ? Pin
E_Gold21-Oct-09 22:53
E_Gold21-Oct-09 22:53 
AnswerRe: How to pass any text value from form to Crystal Report ? Pin
Arun Kallingal22-Oct-09 18:24
Arun Kallingal22-Oct-09 18:24 
QuestionSort and get element Pin
abbd21-Oct-09 22:47
abbd21-Oct-09 22:47 
AnswerRe: Sort and get element Pin
nagendrathecoder21-Oct-09 22:53
nagendrathecoder21-Oct-09 22:53 
GeneralRe: Sort and get element Pin
abbd21-Oct-09 22:57
abbd21-Oct-09 22:57 
GeneralRe: Sort and get element Pin
nagendrathecoder21-Oct-09 23:24
nagendrathecoder21-Oct-09 23:24 
AnswerRe: Sort and get element Pin
stancrm21-Oct-09 23:29
stancrm21-Oct-09 23:29 
QuestionWindows programming in C# - API and All? Pin
CelestialCoder21-Oct-09 22:08
CelestialCoder21-Oct-09 22:08 
AnswerRe: Windows programming in C# - API and All? Pin
Richard MacCutchan21-Oct-09 22:49
mveRichard MacCutchan21-Oct-09 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.