Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 75 Time: 02:38 - Nov 02, 2009  

gauravsagargupta

how we can get list of connected IP in LAN using C#

hi
I am facing difficulty in getting IP details of all connected users using the same application as is in the case of IP messenger tool which helps us find Users using the same tool on different machines.
Can anyone help me how to broadcast our IP to all connected IP's Or How to get connected IP's in same LAN network.
Thanks in advance

Categories

Answer Discussion
Tutorials

 

discord

Date:: Nov 02, 2009

Time:: 14:40

Are you trying to get the IPs for a specific service, all services?

gauravsagargupta

Date:: Nov 03, 2009

Time:: 02:27

Hi discord
I am trying to get IP's and associated User Name so that i can display them on my chat messanger...but i am not maintaining user database and am using udp protocol for data exchange using C#
Whenever tool is run it asks for temporary user name and associates it with the System IP.Then common chat room is displayed where in we can see all connected Users(with temp user names and there system IP's).
I need help to get these list of users on each connected system so that every user can see users available on LAN.
i tried following code
IPAddress[] ips = Dns.GetHostAddresses(Dns.GetHostName());
but of no use..
Please Help

gauravsagargupta

Date:: Nov 03, 2009

Time:: 07:35

I am establishing P2P connection...

discord

Date:: Nov 03, 2009

Time:: 08:57

The users you are trying to get a list of, how are they connecting? If it is the users on your own program, you should be getting that info and persisting a list of users and IPs that connect to it when you receive a UDP packet. Since UDP is connectionless, your protocol for you tool, may need to send the IP and User name every time in the UDP data.

gauravsagargupta

Date:: Nov 03, 2009

Time:: 10:28

Hi Discord
Thanks for your response again.
Right now I am entering IP in text box manually ... how to get System IP of the same machine in textbox..Please provide the required code,if possible, to automatically get current system ip in textbox

discord

Date:: Nov 03, 2009

Time:: 10:39

String strHostName = DNS.GetHostName();

IPHostEntry ipEntry = DNS.GetHostByName(strHostName);

IPAddress[] addresses = ipEntry.AddressList;

gauravsagargupta

Date:: Nov 03, 2009

Time:: 12:03

Thanks Man...Now i know what was wrong....u r a life saver

discord

Date:: Nov 03, 2009

Time:: 12:04

Your welcome

Question Answered

This question has been closed, and points have been rewarded to the following experts:


discord: 75

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No tutorials have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10279

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es