Vb.net如何远程获取另一台计算机的IP地址 [英] Vb.net how to get ip address of another computer remotely
本文介绍了Vb.net如何远程获取另一台计算机的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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)
推荐答案
嗯。
想想你想要做什么:你试图通过网络获取计算机的IP地址,这意味着你需要IP地址才能与之交谈...
这可能有所帮助:检索局域网的IP和MAC地址 [ ^ ] - 它在C#中,但在线转换可以为您排序(或更好的是,把它留在C#中并将它放在它自己的程序集中 - 然后你可以从VB调用方法而没有任何问题。)
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).
这篇关于Vb.net如何远程获取另一台计算机的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文