A step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.
A C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.
This tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.
Creating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.
Get the IP of a hostGetting the IP address and host name of a host / webhost using System.Net. |
On Tuesday, June 15th 2004 at 11:14 AM By Andrew Pociu (View Profile) ![]() ![]() ![]() ![]() (Rated 4.5 with 11 votes) |
||
The following code asks you for a host and then returns the IP address of that host. The code is self-explanatory thanks to the comments.
Here is an example result:
Also if you want to return the hostname of an IP use Dns.Resolve() instead of Dns.GetHostByName. |
|||
Digg It!
Del.icio.us
Reddit
StumbleIt
Newsvine
Furl
BlinkList
|
|||
|
|||
Current Commentsther reverse can be done very easily too by just exchanging the
Dns.GetHostByName(host);
for
Dns.GetHostByAddress(IP);
this will only work if the dns entry has a reverse lookup though.
i want information about code get ip header in c#
Perfect tutorial!!
Why the application close automatically before I see the result???
Thanks for share this tutorial???
"Why the application close automatically before I see the result???
Thanks for share this tutorial???"
Because it has finished it's job. Add Console.Readline after "try".
Simple but effective!
Related Tutorials
Related Source Code
C# Job Search