Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i have a problem here. i need code in vb.net to detect the computer name n the ip address....tq
Posted

how do you want to get the PC name , by win form or aspx ?
 
Share this answer
 
Comments
shantapanic 14-Dec-12 19:48pm    
actually i want to run task manager of other ppl s pc from my laptop.....so i need to click on the PC name of other to run the task manager from my laptop
shantapanic 14-Dec-12 20:04pm    
can i get by both aso....by win form and aspx...
Fetch Computer Name By
VB
MsgBox(My.Computer.Name)
 
Share this answer
 
Private Function IPAddress() As String
           Dim strIP As String = ""
           Dim LocalHostName As String
           Try
               LocalHostName = Dns.GetHostName()  'Here u will get ur system Name
               Dim ipEnter As IPHostEntry = Dns.GetHostEntry(LocalHostName)
               Dim IpAdd() As IPAddress = ipEnter.AddressList
               strIP = IpAdd(0).ToString()
               Return strIP  'It will return ipaddress of ur system
           Catch ex As Exception
               Throw New Exception(ex.Message)
           End Try
       End Function


and add namespace:
Imports System.Net
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900