C# - Release IP of specific adapter, and then renew (via DHCP) IP of that same adapter (after various tests run of course)
Posted on 2008-10-31
Ok... here is the problem that I need to resolve.
have built code in my app to find specific information about all of the installed adapters, which includes:
1) IP address
2) Adapter Description
3) MAC address of adapter.
Now, what I need to be able to do, is:
Step 1) Specify a given adapter, release the IP address which is assigned to it (assigned by DHCP)
Step 2) Run some various tests that I'm working on building (network communication tests)
Step 3) Specify the given adapter and renew the IP for that adapter via DHCP.
Factors to keep in mind:
1) This will be utilized on machines with as many as 3 network interfaces (2 physical and 1 virtual)
2) I need to be able to release & Renew ALL IP info for the specified adapter. (including IP, Mask, DNS, etc)
Thanks in advance for any code examples that I could learn from!