Kann nicht analysieren, domain in IP, die in C#?

Habe ich diesen code:

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

Wenn ich eine IP in die txtBoxIP (192.168.1.2) zum Beispiel funktioniert es Super.

Aber wenn will ich eine DNS? so, ich bin putting - (my.selfip.com) ich bekomme:

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

Wie kann ich es unterstützen sowohl IP-und DNS ?

  • Ich habe entfernt die Analyse - tag, wie die Umwandlung von Hostnamen in eine IP ist bekannt als "address resolution" eher als "analysieren".
InformationsquelleAutor Danpe | 2011-06-27
Schreibe einen Kommentar