c# – Website IP address


Hello to all. How to get the port of the site by the site address and display it in a text field in C#?


List of ip addresses from dns:


I think you can guess how to pull it out of the collection and shove it into the textbox.

To pull out the port from the address, I think you also think of it? You can explore and use the Uri class:

new Uri("http://www.yandex.ru:9000").Port
Scroll to Top