Code to connect with internet
Posted on 2008-11-06
I have a external network adapter and want to program it.
I plugged it into a computer and want to connect it to internet programmatically in c++.
I can retrieve MAC address of the adapter by using IpHelper GetAdapterAddresses().
I want to connect that adapter with internet using C++. So far when I retrieve IP address it gives me 0.0.0.0 IP address. The reason is understandable, because I have just plugged in the adapter, I have not connect it with internet. I want to connect it with internet and get IP address using C++. My question may have the following answer, (Note the language is C++)
1. Connect with internet
2. Automatically get IP address from DHCP server.
But I dont know how to do this in c++.
Looking for your response.