473,387 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to retrieve IP address ???

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
3 2267
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Gidraz | last post by:
Hello, i can't figure out how to retrieve clients MAC address using C#.NET. I can get IP but not MAC. Thanks in advance. Gidraz
6
by: Daniele | last post by:
Hi all, We are developing a .net application that can accept xml documents. Every xml document can match a single schema, or it may be composed by multiple different elements and each of these...
0
by: rey17 | last post by:
hi i'm working on a project and my application will be running on pocket pc(i'm using .NET CF). basically my application should be able to retrieve my pocket's ipv6 address (it's the link-local...
3
by: serge calderara | last post by:
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...
2
by: Noro | last post by:
Hi All, When I try to get the email address of the current user, I retrieve a string like this that represents the email address: /o=ORGANIZATION/ou=Sede/cn=Recipients/cn=USERNAME What can...
4
by: kang jia | last post by:
hi i am doing mailinglist currently. the code in my first page is like this : : <html> <head> <link rel="stylesheet" type="text/css" href="gallery.css" /> <script language="JavaScript"> ...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I am using a web browser control to browse windows explorer. I give it a default address as below and then click on some folder. The question is: how do I retrieve the address of...
3
by: Keith Thompson | last post by:
Victor <vhnguyenn@yahoo.comwrites: You're declaring an array of pointers to unsigned long long, but you're initializing the pointers with integer values. This is actually a constraint...
12
lifeisgreat20009
by: lifeisgreat20009 | last post by:
I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn't get much help so finally I am here.. Hoping of getting my problem solved. Please...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.