Click here to Skip to main content
15,791,739 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have get code the ip address of local machine to connected lan to an internet searching and working fine.

But when i disconnect the lan, the ip address not coming and also assigned my ip address in tcp properties.

How can i solve the above problem???
Please help me any one....

It's vital to me.
Thank you..
Richard MacCutchan 22-Aug-14 9:25am    
Why would you expect to get the information when not connected? That is a prerequisite for networks.
PIEBALDconsult 22-Aug-14 10:23am    
With the use of DHCP, IP addresses aren't very useful for identification purposes.
What code do you have now?
Is this a business situation with a DNS server?


Add DWORD value: DisableDHCPMediaSense Make it equal to 1

Reboot and enjoy your static IP address on disconnected LAN port.
Share this answer
If something is not connected, it doesn't have an address.
It's like your phone: take the sim card out and it can't connect to the network anymore, and it doesn't have a mobile number...put the sim in a different phone: it can connect and it gets the phone number.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900