By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,212 Members | 2,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,212 IT Pros & Developers. It's quick & easy.

How to retrieve IP address ???

P: n/a
Dear all,

I have a tool which is able to receive any kind of data
from a remote system.
For that I need to get the ipadress of the remote system.

If the system is not connected to a DHCP server no
problem , I set in my configuration the ip adress.

Then if my remote system is connected to a DHCP server,
how can I get retriev the given IP adress ?

thanks for your help
regards
serge

Jul 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Serge,

Do you have the machine name or DNS name of the machine? If so you can use
System.Net.Dns.GetHostByName("theName") to get the IP address(es) for the
machine.

Such as:
IPHostEntry hostInfo = Dns.GetHostByName("jimblizz01");
Console.WriteLine("host name: " + hostInfo.HostName);
IPAddress[] address = hostInfo.AddressList;
Console.WriteLine("\nIP address list : ");
for(int index=0; index < address.Length; index++)
{
Console.WriteLine(address[index]);
}

Console.ReadLine();

Hope this helps,
- bliz

Jim Blizzard, MCSD .NET | http://www.snowstormlife.com/blog
Community Developer Evangelist | http://www.microsoft.com/communities

This posting is provided AS IS, without warranty and confers no rights.
"serge calderara" <se*************@maillefer.net> wrote in message
news:0a****************************@phx.gbl...
Dear all,

I have a tool which is able to receive any kind of data
from a remote system.
For that I need to get the ipadress of the remote system.

If the system is not connected to a DHCP server no
problem , I set in my configuration the ip adress.

Then if my remote system is connected to a DHCP server,
how can I get retriev the given IP adress ?

thanks for your help
regards
serge

Jul 21 '05 #2

P: n/a
Thanks for your answer....
Yes the only thing I might know is the name of the PC.
But the way my customer will handle name resolution is not
under my control.

Can I used what you suggest?

regards
serge
-----Original Message-----
Hi Serge,

Do you have the machine name or DNS name of the machine? If so you can useSystem.Net.Dns.GetHostByName("theName") to get the IP address(es) for themachine.

Such as:
IPHostEntry hostInfo = Dns.GetHostByName("jimblizz01");
Console.WriteLine("host name: " + hostInfo.HostName);
IPAddress[] address = hostInfo.AddressList;
Console.WriteLine("\nIP address list : ");
for(int index=0; index < address.Length; index++)
{
Console.WriteLine(address[index]);
}

Console.ReadLine();

Hope this helps,
- bliz

Jim Blizzard, MCSD .NET | http://www.snowstormlife.com/blogCommunity Developer Evangelist | http://www.microsoft.com/communities
This posting is provided AS IS, without warranty and confers no rights.

"serge calderara" <se*************@maillefer.net> wrote in messagenews:0a****************************@phx.gbl...
Dear all,

I have a tool which is able to receive any kind of data
from a remote system.
For that I need to get the ipadress of the remote system.
If the system is not connected to a DHCP server no
problem , I set in my configuration the ip adress.

Then if my remote system is connected to a DHCP server,
how can I get retriev the given IP adress ?

thanks for your help
regards
serge

.

Jul 21 '05 #3

P: n/a
I don't quite understand the situation when you say name resolution isn't
under your control....

If you have the machine name, you should be able to get the IP address.

Can you clarify?

Thanks!

--
Jim Blizzard, MCSD .NET
Community Developer Evangelist | www.microsoft.com/communities
--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).
--------------------
Content-Class: urn:content-classes:message
From: "serge calderara" <se*************@maillfer.net>
Sender: "serge calderara" <se*************@maillfer.net>
References: <0a****************************@phx.gbl> <3f********@news.microsoft.com>Subject: Re: How to retrieve IP address ???
Date: Wed, 22 Oct 2003 23:42:53 -0700 Thanks for your answer....
Yes the only thing I might know is the name of the PC.
But the way my customer will handle name resolution is not
under my control.

Can I used what you suggest?

regards
serge
-----Original Message-----
Hi Serge,

Do you have the machine name or DNS name of the machine?

If so you can use
System.Net.Dns.GetHostByName("theName") to get the IP

address(es) for the
machine.

Such as:
IPHostEntry hostInfo = Dns.GetHostByName("jimblizz01");
Console.WriteLine("host name: " + hostInfo.HostName);
IPAddress[] address = hostInfo.AddressList;
Console.WriteLine("\nIP address list : ");
for(int index=0; index < address.Length; index++)
{
Console.WriteLine(address[index]);
}

Console.ReadLine();

Hope this helps,
- bliz

Jim Blizzard, MCSD .NET |

http://www.snowstormlife.com/blog
Community Developer Evangelist |

http://www.microsoft.com/communities

This posting is provided AS IS, without warranty and

confers no rights.


"serge calderara" <se*************@maillefer.net> wrote

in message
news:0a****************************@phx.gbl...
Dear all,

I have a tool which is able to receive any kind of data
from a remote system.
For that I need to get the ipadress of the remotesystem.
If the system is not connected to a DHCP server no
problem , I set in my configuration the ip adress.

Then if my remote system is connected to a DHCP server,
how can I get retriev the given IP adress ?

thanks for your help
regards
serge

.


Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.