Hello All,
Recentely I have asked some questions which i could not answered.Please give me answers to the following questions.
1. How do we find the hostname and IP address of a remote PC using .NET coding.
2.What is the port no. of the SMTP Server.
3.On which port IIS Server is running.
My email ids are
Thanks & Regards
Prashant S. More
Prashant MorePosted Jul 2, 2008, 8:26 AM
Hello Mam,
Thanks for your reply.but i could not get you what is mean by another.Please send me the code.
Thanks & Regards
Prashant S. More
Vijaya KadiyalaPosted Jun 30, 2008, 2:46 PM
Hi,
When you say, you want to find out the remote PC Hostname and IP Address..You can't find both. you need to have to find another.
Thanks -- Vj
Prashant MorePosted Jun 28, 2008, 8:28 AM
Respected Sir,
Thanks for your reply.But my question is
How to find the hostname and IP address of the remote PC not a local machine.So sir please send me the proper code
Thanks & Regards
Prashant S. More
Niradhip ChakrabortyPosted Jun 27, 2008, 7:28 AM
What is the port no. of the SMTP Server?
ans:port 25
On which port IIS Server is running?
ans:port 80
getting Ip address:
Try this console app:
using System;
using System.Net;
class Program
{
static void Main()
{
string hostName = Dns.GetHostName(); // gets host name for local machine
Console.WriteLine("Host Name = " + hostName);
IPHostEntry local = Dns.GetHostByName(hostName);
// there may be more than one IPAddress associated with local machine
foreach(System.Net.IPAddress ipaddress in local.AddressList)
{
Console.WriteLine("IPAddress = " + ipaddress.ToString());
}
}
}