0

I want to know how can I send a textbox text through WAN and the other form open in another computer uses the text that I sent as his textbox text.

Basically it's sending a control data to another form that is open in another computer.

How can I do this? I thought on using TCP or something but I didn't understand so much that I could modify it to send large texts and use it.

1 Answers1

0

Nicolas, now that we are clear: the most straightforward way of doing this is opening a socket to send your data. Although I believe this is a bit exagerated for most scenarios, it may resolve your problem.

Note, however, that if you have an assynchronous scenario (that is, user at PC B do not knows when user at PC A is ready to send data), then PC B (the receiver) will have to keep the socket opened, what is a bad idea. Try to figure out if you can "schedule" when data will be sent.

Take a look at this little tutorial. Create a new project only to learn how to send and receive data from a socket. When you find any touble, do a little search about it. There are lots of references on the internet, including at StackOverflow.

Hope this helps.

Andre Calil
  • 7,652
  • 34
  • 41
  • Thanks, Andre. But I didn't find any reference on how to send large data through sockets. I'm not a professional C# programmer, I'm more like average. If you found anything that reefers right into what I want, please send it to me. – Nicolas Mossmann Jul 03 '12 at 13:18
  • Nicolas, what do you mean by large data? A string, maybe? Notice that the *send* method receives a byte[], you can convert your string to this array by using Encoding.UTF8.GetBytes(yourString). – Andre Calil Jul 03 '12 at 15:02