How do I use WSAStartup() in C# ??
-
Hiya I need to get WSAStartup in working C#. I have done this to get the function loaded in the project: #region SOCKETS [DllImport("wsock32.dll")] static extern int WSAStartup( uint wVersionRequested,LPWSADATA lpWSAData ); #endregion The problem is that I don't know the namespace that LPWSADATA uses. This anyone know what the namespace is for this structure?? Thanks.
-
Hiya I need to get WSAStartup in working C#. I have done this to get the function loaded in the project: #region SOCKETS [DllImport("wsock32.dll")] static extern int WSAStartup( uint wVersionRequested,LPWSADATA lpWSAData ); #endregion The problem is that I don't know the namespace that LPWSADATA uses. This anyone know what the namespace is for this structure?? Thanks.
Any reason why you're not using the System.Net.Socket class?
-
Hiya I need to get WSAStartup in working C#. I have done this to get the function loaded in the project: #region SOCKETS [DllImport("wsock32.dll")] static extern int WSAStartup( uint wVersionRequested,LPWSADATA lpWSAData ); #endregion The problem is that I don't know the namespace that LPWSADATA uses. This anyone know what the namespace is for this structure?? Thanks.
I don't think there is a public declaration of the WSADATA structure in any namespace Microsoft provides. Typically, writing in managed code, you don't need to call WSAStartup directly, using code in the System.Net.Sockets namespace will take care of calling it automatically for you. Is there some reason System.Net.Sockets isn't doing what you want? Burt Harris
-
I don't think there is a public declaration of the WSADATA structure in any namespace Microsoft provides. Typically, writing in managed code, you don't need to call WSAStartup directly, using code in the System.Net.Sockets namespace will take care of calling it automatically for you. Is there some reason System.Net.Sockets isn't doing what you want? Burt Harris
The simple reason is I am much more comfortable with using WSAStartup sockets. I am not to sure how to use C# sockets as I am only learning C# (not sockets) the last few weeks. My objective is display a list of network users and their IP Addresses. Thats all i want to do.. If somebody can plz show me how to do this in c#, I would be very grateful. Thanks.