how to get the local machine IP address???


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: how to get the local machine IP address???

  1. #1
    Filipo Mór Guest

    how to get the local machine IP address???



    Hi, pals!

    I need to get the local machine IP address (the address 127.0.0.1 doesn't
    work for my application). How can I do that??? Is there some windows API
    capable to return this information to me? I would like to use it from VB6.

    Cheers!

    Filipo


  2. #2
    ynwt Guest

    Re: how to get the local machine IP address???


    Filipo,
    If you could use component, use WinSock control and you can get LocalIP for
    current machine IP.

    Rgds,
    ynwt
    ===

    "Filipo Mór" <fifo@banrisul.com.br> wrote:
    >
    >
    > Hi, pals!
    >
    > I need to get the local machine IP address (the address 127.0.0.1 doesn't
    >work for my application). How can I do that??? Is there some windows API
    >capable to return this information to me? I would like to use it from VB6.
    >
    > Cheers!
    >
    > Filipo
    >



  3. #3
    R Shroff Guest

    Re: how to get the local machine IP address???


    Dear Filipo,

    Use :

    Private Declare Function gethostbyname Lib "WSOCK32.DLL" (ByVal _
    hostname$) As Long

    This returns 0 for error or the HOSTENT address as a long. The HOSETENT is
    a UDT.

    You can use :
    Private Declare Function gethostname Lib "WSOCK32.DLL" (ByVal hostname$,_
    ByVal HostLen as Long) as long
    to get the HostName.

    Regards, Roomy.

    "Filipo Mór" <fifo@banrisul.com.br> wrote:
    >
    >
    > Hi, pals!
    >
    > I need to get the local machine IP address (the address 127.0.0.1 doesn't
    >work for my application). How can I do that??? Is there some windows API
    >capable to return this information to me? I would like to use it from VB6.
    >
    > Cheers!
    >
    > Filipo
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center