Click here to Skip to main content
15,891,316 members
Articles / Programming Languages / VBScript

System Name and IP Address

Rate me:
Please Sign up or sign in to vote.
2.45/5 (10 votes)
16 Feb 2006CPOL 41K   1.2K   15  
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:

VB.NET
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
VB.NET
Private Declare Sub RtlMoveMemory Lib "KERNEL32" _
        (hpvDest As Any, ByVal hpvSource&, ByVal cbCopy&)

Used const variables are as follows:

VB.NET
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
Pakistan Pakistan
Muhammad Ghufran is working as Team Lead in a
Multinational Company.

Comments and Discussions

 
-- There are no messages in this forum --