473,395 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

What is the command to display computer name & ip address ?

What is the command to display computer name & ip address in VB.NET 2005 (OS
WindowsXP & Windows Vista)
Regards,
Tee

Jun 27 '08 #1
5 3712
"Eng Teng" <en*****@gmail.comschrieb
What is the command to display computer name & ip address in VB.NET
2005 (OS WindowsXP & Windows Vista)
Environment.MachineName or SystemInformation.Computername, and
http://groups.google.com/group/micro...d407946e79f801
Armin

Jun 27 '08 #2
On May 2, 3:48 pm, "Eng Teng" <engt...@gmail.comwrote:
What is the command to display computer name & ip address in VB.NET 2005 (OS
WindowsXP & Windows Vista)

Regards,
Tee
Hi Eng,
For short ways,

' To display computer name:

My.Computer.Info.OSFullName

' To display local IP:
Imports System.net
Module Module1

Sub Main()
'To get local address
Dim sHostName As String
Dim i As Integer
sHostName = Dns.GetHostName()
Dim ipE As IPHostEntry = Dns.GetHostByName(sHostName)
Dim IpA() As IPAddress = ipE.AddressList
For i = 0 To IpA.GetUpperBound(0)
Console.Write("IP Address {0}: {1} ", i, IpA(i).ToString)
Next

Console.ReadLine()
End Sub
End Module
Hope this helps,

Onur Güzel
Jun 27 '08 #3
How about Service Pack info ?

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:c3**********************************@24g2000h sh.googlegroups.com...
On May 2, 3:48 pm, "Eng Teng" <engt...@gmail.comwrote:
What is the command to display computer name & ip address in VB.NET 2005
(OS
WindowsXP & Windows Vista)

Regards,
Tee
Hi Eng,
For short ways,

' To display computer name:

My.Computer.Info.OSFullName

' To display local IP:
Imports System.net
Module Module1

Sub Main()
'To get local address
Dim sHostName As String
Dim i As Integer
sHostName = Dns.GetHostName()
Dim ipE As IPHostEntry = Dns.GetHostByName(sHostName)
Dim IpA() As IPAddress = ipE.AddressList
For i = 0 To IpA.GetUpperBound(0)
Console.Write("IP Address {0}: {1} ", i, IpA(i).ToString)
Next

Console.ReadLine()
End Sub
End Module
Hope this helps,

Onur Güzel

Jun 27 '08 #4
On May 2, 6:24 pm, "Eng Teng" <engt...@gmail.comwrote:
How about Service Pack info ?

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:c3**********************************@24g2000h sh.googlegroups.com...
On May 2, 3:48 pm, "Eng Teng" <engt...@gmail.comwrote:
What is the command to display computer name & ip address in VB.NET 2005
(OS
WindowsXP & Windows Vista)
Regards,
Tee

Hi Eng,
For short ways,

' To display computer name:

My.Computer.Info.OSFullName

' To display local IP:
Imports System.net
Module Module1

Sub Main()
'To get local address
Dim sHostName As String
Dim i As Integer
sHostName = Dns.GetHostName()
Dim ipE As IPHostEntry = Dns.GetHostByName(sHostName)
Dim IpA() As IPAddress = ipE.AddressList
For i = 0 To IpA.GetUpperBound(0)
Console.Write("IP Address {0}: {1} ", i, IpA(i).ToString)
Next

Console.ReadLine()
End Sub
End Module

Hope this helps,

Onur Güzel
To get Service Pack version,
simply use;

Environment.OSVersion.ServicePack

Hope this helps,

Onur Güzel
Jun 27 '08 #5
http://msdn.microsoft.com/en-us/library/aa394582.aspx
"Eng Teng" <en*****@gmail.comschreef in bericht
news:%2****************@TK2MSFTNGP05.phx.gbl...
How about Service Pack info ?

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:c3**********************************@24g2000h sh.googlegroups.com...
On May 2, 3:48 pm, "Eng Teng" <engt...@gmail.comwrote:
>What is the command to display computer name & ip address in VB.NET 2005
(OS
WindowsXP & Windows Vista)

Regards,
Tee

Hi Eng,
For short ways,

' To display computer name:

My.Computer.Info.OSFullName

' To display local IP:
Imports System.net
Module Module1

Sub Main()
'To get local address
Dim sHostName As String
Dim i As Integer
sHostName = Dns.GetHostName()
Dim ipE As IPHostEntry = Dns.GetHostByName(sHostName)
Dim IpA() As IPAddress = ipE.AddressList
For i = 0 To IpA.GetUpperBound(0)
Console.Write("IP Address {0}: {1} ", i, IpA(i).ToString)
Next

Console.ReadLine()
End Sub
End Module
Hope this helps,

Onur Güzel
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Maverick | last post by:
I'm trying to get the " Computer Name " of a client accessing my web site, is there a way to do this ? not ip... tia
3
by: JayPee | last post by:
Here is my dilema. I'm running IIS on a Windows 2000 Proffessional PC. I'm a running a small intranet site off this machine which is accessible by the end users by typing in the computer name of...
4
by: Sweety | last post by:
plz reply, thanks in advance. bye
1
by: Uzi Baruch | last post by:
Hi! i want to know if i have an ip address of a computer and its DNS server name, if their is an windows API that can resolve the computer name of the given ip address. or vice verca -...
9
by: Dan Nash | last post by:
Heylo I want to be able to get the computer name from my C# page. Is this possible? Basically, I'm developing a auto-bugreport feature for an intranet and want to know which machine sent the...
8
by: Paul Bromley | last post by:
Thanks for your tolerance on this list. I asked the question regarding Commercial Copy Protection along with Unique PC Idnetifier and obtaining the active IP address. This was all to identify and...
6
by: ajays | last post by:
I want to get the full computer name using the ActiveState Perl on windows . Actually i can get that using the "hostname" command, but i want to have the output of the "hostname" command stored in...
1
by: kartik369 | last post by:
This code gets the IP address from the computer name we already know. I wanted to know how can we get the computer name if we know the IP address. Thanks void AsyncServer::InitSocks() {...
11
by: need2know | last post by:
Just purchased a dell system and compleated the set up process. I am concerned though. On the enter computer name and administrator password screen i entered a password. I thought it would have been...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.