1 Attachment(s)
Example code for LAN information?
Hi everyone!
I have downloaded the attached file from planet source, just to see how winsock works and how can i get information from a local network, but the problem is that when i try to run the code nothing happens.
Can someone check the file for me and see whats wrong?, im a noob working with winsock.
Thanks a lot.
Re: Example code for LAN information?
Any help on this will be really appreciated
Re: Example code for LAN information?
I am not at all conversant with the Winsock control & hence can't help you with what you have already done. Nevertheless have a look at this post though it doesn't use the Winsock control. It uses the Inet control. The code actually finds what sort of internet connection a user uses (modem/LAN etc.), bytes sent & bytes received & the connection speed. frmWebBrowser is a Form with the WebBrowser control & wWeb is the name of the WebBrowser control.
You will have to modify the code to suit to your needs.
Re: Example code for LAN information?
I tried running that program from your zip file and it is a problem. It goes into Do..While loop and never gets out of it. The loop is entered before the Form is shown. I am not going to try to figure it out. So what exactly do you want to know?
Re: Example code for LAN information?
It's pretty naff code and I've not an idea what it's supposed to do but in Class CompName you need to change the existing assingment of values to tNetRes to:
Code:
With tNetRes
.lpLocalName = sDomain
.dwDisplayType = 1
.dwUsage = 2
End With
The problem is that WNetOpenEnum was failing with error 87 (Invalid Parameter) and the thing was going into an infinite loop.