Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how can i find ip address of other computers remotely?
it does not matter using cmd or others, as long it is in vb code.


What I have tried:

i have tried using cmd, but the arguments is for own pc.

Dim ps As New Process
With ps.StartInfo
.FileName = "cmd.exe"
.Arguments = "/C ipconfig | findstr /i ipv4"
.CreateNoWindow = True
.UseShellExecute = False
.RedirectStandardOutput = True
End With

ps.Start()
ps.WaitForExit()

Dim output As String = ps.StandardOutput.ReadToEnd()
ps.Close()
MsgBox(output)
Posted
Updated 29-Apr-18 23:38pm

1 solution

Um.
Think about what you are trying to do: you are trying to get the IP address of a computer via your network, which means you need the IP address in order to talk to it...

This may help: Retrieving IP and MAC addresses for a LAN[^] - it's in C#, but online convertes can sort that for you (or better, leave it in C# and put it in it's own assembly - you can then call the methods from VB without any problems).
 
Share this answer
 

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