Results 1 to 5 of 5

Thread: Example code for LAN information?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    292

    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.
    Attached Files Attached Files
    Last edited by em07189; Jan 18th, 2008 at 04:17 PM.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    292

    Re: Example code for LAN information?

    Any help on this will be really appreciated

  3. #3
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    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.


    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?

  4. #4
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    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?

  5. #5
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width