如何在VB.NET中创建连接空间
问题描述:
我正在制作一个从其他计算机发送一个文件的应用程序,它运行良好,当你作为客户端启动时我想要的东西你可以选择de server de server(就像你加入什么时的Halo CE在一个游戏中),因为可以在不同的计算机上打开,我不会一直说de IP
我尝试了什么:
我找不到任何我发现的东西:
I'm making a application for send one file from other computer and it work well, the thing I want its when you start as a client you can select de IP of de server (like a Halo CE when you what to join in a game), because can be open in diferents computers and I don't what say de IP all the time
What I have tried:
I don't found anything I only found this:
If My.Computer.Network.Ping("192.168.1.71") Then
MsgBox("Server pinged successfully.")
Else
MsgBox("Ping request timed out.")
End If
答
将已知IP存储在配置文件中,并在启动应用程序时将其读入ComboBox,或者您可以获取LAN网段上的所有IP地址,并将其加载到ComboBox中,如果您只想使用本地IP地址。
对于LAN IP,请参见此处:检索局域网的IP和MAC地址 [ ^ ]由于显而易见的原因,你无法检索互联网上的所有IP地址......
Either store the "known IP's" in a configuration file, and read it into a ComboBox when you start the application, or you can pick up all the IP addresses on your LAN segment and load them into a ComboBox if you want to use only local ones.
For LAN IP's, see here: Retrieving IP and MAC addresses for a LAN[^] For obvious reasons, you cannot retreive all IP addresses on the internet ...