C# Host with IP address detect!
-
Hey guys! This is a code for that! http://dotnet-snippets.de/dns/host-via-ip-adresse-ermitteln-SID977.aspx[^] I want to read the Ip from a TextBox out and then he should show me the hostname in a other textbox. And i don´t know what code i should add!
-
Hey guys! This is a code for that! http://dotnet-snippets.de/dns/host-via-ip-adresse-ermitteln-SID977.aspx[^] I want to read the Ip from a TextBox out and then he should show me the hostname in a other textbox. And i don´t know what code i should add!
-
If you just want to call that method from your code, try this.
targetTextBox.Text = GetHostNameByIp ( sourceTextBox.Text ) ;
Ok! It´s a code to show me the Host from a Ip and he must get the ip from where! And how can i add a code to read the Ip from a textbox out? then the host name should he show me in another textbox or in the same
-
Ok! It´s a code to show me the Host from a Ip and he must get the ip from where! And how can i add a code to read the Ip from a textbox out? then the host name should he show me in another textbox or in the same
The code in the example I gave you should be what you need.
targetTextBox.Text = GetHostNameByIp ( sourceTextBox.Text ) ;
Or try this.
string ipAddress = sourceTextBox.Text ; // This is the text box holding the IP Address.
string hostName = GetHostNameByIp ( ipAddress ) ; // Get the Hostname.
targetTextBox.Text = hostName ; // Put the Hostname in the other text box.This is the same as the single-line example.
-
Hey guys! This is a code for that! http://dotnet-snippets.de/dns/host-via-ip-adresse-ermitteln-SID977.aspx[^] I want to read the Ip from a TextBox out and then he should show me the hostname in a other textbox. And i don´t know what code i should add!
i have the solution!
-
i have the solution!
thank you for help :thumbsup: