Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

System Name and IP Address

0.00/5 (No votes)
16 Feb 2006 1  
Program to get System Name and IP Address
Sample Image - SystemInfo.jpg

Introduction

The application is created to get an IP Address of a system. Also it gets the name of the System.

Used DLLs are as follows:

Private Declare Function WSAGetLastError Lib "WSOCK32.DLL" () As Long
Private Declare Function WSAStartup Lib "WSOCK32.DLL" _
        (ByVal wVersionRequired&, lpWSAData As WSADATA) As Long
Private Declare Function WSACleanup Lib "WSOCK32.DLL" () As Long
Private Declare Function gethostname Lib "WSOCK32.DLL" _
        (ByVal hostname$, ByVal HostLen&) As Long
Private Declare Function gethostbyname Lib "WSOCK32.DLL" _
        (ByVal hostname$) As Long
Private Declare Sub RtlMoveMemory Lib "KERNEL32" _
        (hpvDest As Any, ByVal hpvSource&, ByVal cbCopy&)

Used const variables are as follows:

Private Const WS_VERSION_REQD = &H101
Private Const WS_VERSION_MAJOR = WS_VERSION_REQD \ &H100 And &HFF&
Private Const WS_VERSION_MINOR = WS_VERSION_REQD And &HFF&
Private Const MIN_SOCKETS_REQD = 1
Private Const SOCKET_ERROR = -1
Private Const WSADescription_Len = 256
Private Const WSASYS_Status_Len = 128

It's a simple project that will help you a little more to boost you up.

History

  • 17th February, 2006: Initial post

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here