Re: System.Net.Sockets Help
There's a .NET based Winsock available here that you may want to look into:
http://www.codeproject.com/vb/net/winsockdotnet.asp
I haven't had much time to do anything with it yet, but it SHOULD be basically equivilant to the Winsock used in VB6, but with some other added functionality thanks to the .NET framework.
Re: System.Net.Sockets Help
To send data, you need to write to the networkstream.
Heres an example
VB Code:
'SomeClient is a System.Net.Sockets.TcpClient class
Try
Using sw As New IO.StreamWriter(SomeClient.GetStream)
sw.Write("Hey")
End Using
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
Re: System.Net.Sockets Help
Quote:
Originally Posted by Campion
There's a .NET based Winsock available here that you may want to look into:
http://www.codeproject.com/vb/net/winsockdotnet.asp
I haven't had much time to do anything with it yet, but it SHOULD be basically equivilant to the Winsock used in VB6, but with some other added functionality thanks to the .NET framework.
Great answer thanks dude you helped me out and stopped me threading :o)
Re: System.Net.Sockets Help
Quote:
Originally Posted by r1chyb
Great answer thanks dude you helped me out and stopped me threading :o)
But why would you want to use that? If the answer is "Because then the code is already written for me", then one could ask why you are programming in the first place. You will have to package extra stuff along with your project and make it more bulky and you will never learn the techniques of socket programming which is very good to know. The .Net framework already provides us with a great number of classes to do whatever we want, why download extra classes?
This Winsock.Net control is apparently made by a VB6 programmer that misses the winsock control in .Net. An attempt to make .Net more like VB6..bah.
Re: System.Net.Sockets Help
Quote:
Originally Posted by Atheist
This Winsock.Net control is apparently made by a VB6 programmer that misses the winsock control in .Net. An attempt to make .Net more like VB6..bah.
You may have a point there, but when you download and look at the source code, it's a great way to figure out how it's done in .NET.
I'm trying to learn it the .NET way as well based on the threads I've found on this site, but so far, it's proving to be way too confusing and headache inducing, and ends up resulting in massive failure.