Does anyone know how to get the default gateway in a Delphi 2010 app? I have found some windows functions like GetAdaptersAddresses, but I dont know how to use it.
On Windows XP and later Use the GetAdaptersAddresses instead of GetAdaptersInfo.
There is a set of functions implementing IP Helper APIs. see the delphi web page at Magenta Systems
Edit:
from Remok comment :
GetAdaptersInfo returns ERROR_NO_DATA if there is ONLY an IPv6 address configured. That's why MSDN recommends using GetAdapterAddresses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With