How do I get the identification of the active network card and get the default gateway?

How do I get the identification of the active network card and get the default gateway?

The following code gives you the first Default Gateway:
NetworkInterface card = NetworkInterface.GetAllNetworkInterfaces().FirstOrDefault();
if (card == null)
return null;
GatewayIPAddressInformation address = card.GetIPProperties().GatewayAddresses.FirstOrDefault();
if (address == null)
return null;
return address.Address;