相关疑难解决方法(0)

无法在C#中将域解析为IP?

我有这个代码:

IPEndPoint serverEndPoint = new IPEndPoint(IPAddress.Parse(txtBoxIP.Text), MainForm.port);

例如,当我在txtBoxIP(192.168.1.2)中有IP时,效果很好.

但是,如果我想放一个DNS?就像我放(my.selfip.com)我得到的:

System.FormatException: An invalid IP address was specified.
at System.Net.IPAddress.InternalParse(String ipString, Boolean tryParse)
Run Code Online (Sandbox Code Playgroud)

如何使其支持IP和DNS?

.net c# ip dns

4
推荐指数
1
解决办法
6404
查看次数

标签 统计

.net ×1

c# ×1

dns ×1

ip ×1