how can we get ip address, subnet mask , default gateway and dns server by c# code?
15 Nov 2006
please tell me how can we get ipaddress, subnet mask, default gateway and dns server by c# code?
i have got a code with:
ManagementClass objMC = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection objMOC = objMC.GetInstances();
string ipaddresses = (string) objMO["IPAddress"];
string subnets = (string) objMO["IPSubnet"];
string gateways = (string) objMO["DefaultIPGateway"];
but system.management namespace is working in windows 2000 operating system only ( am i right?) , it is giving error in XP.
please anybody give me the code .
thankzz in advanse
No responses found. Be the first to respond and make money from
revenue sharing program
This thread is locked for new responses. Please post your comments and questions as a
If required, refer to the URL of this page in your
Start new thread
Last 7 Days
Anil Kumar ...
Awards & Gifts
Articles Rss Feeds
Forum Rss Feeds
Talk to Webmaster Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India