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.
Does anyone know how to get the default gateway in a Delphi 2010 app?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.