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.
Last edited by em07189; Jan 18th, 2008 at 04:17 PM.
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.
ARPAN
IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!
NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!
PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?
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?
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.