Winsock. NEED HELP!

Where do i find Winsock in Visual Studio 2005?
im totaly noob so describe so i understand...Smile
[160 byte] By [YoshiNorwaY] at [2007-12-16]
# 1
Yeah, in VB 5.0 it was so easy to create a local network chat program, but now in Visual Studio 2005 i can't even find winsock
TomyJack at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2
Hi mates;
you'll have to forget the old vb 5 or 6 style winsocks.....
just use system.net.sockets.socket class instead, but its not as simple as old winsock... you should know something about asynchronous callbacks, the data no longer comes as string but it is an array of bytes etc...
read about it here.

StormDev at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 3

You can get the old Winsock control from VB5 and 6. All you need to do is click Tools -> Choose Toolbox Items then click the COM tab and find "Microsoft Winsock Control" in the list and click the checkbox next to that. When I did this it appeared in the "Printing" section of the toolbox for some reason. Also, you can click Project -> Add Reference then select "Microsoft Winsock Control" and click OK. Then at the top of your code add this line:

Private WithEvents Winsock As MSWinsockLib.Winsock

Using either of these methods will work the same.

Jackabee at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 4

Public Class Form1

Private WithEvents AxWinsock As MSWinsockLib.Winsock

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

AxWinsock1.SendData(TextBox2.Text)

End Sub

Private Sub AxWinsock1_DataArrival(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles AxWinsock1.DataArrival

Dim strData As String

TextBox1.Text = TextBox1.Text & strData & vbNewLine

End Sub

End Class

=======================================================================

Well, Jackabee it helped now i got winsock control, but i wont get any messages, theres my code can you please tell where is my mistake?

TomyFromLatvia at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 5

hi,

this work in .framework 2.0 and who can i put this work in compact framework do you know another way?

thanks

bruno

Brunosdd at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified