InternetGetConnectedState

[DllImport("wininet.dll", SetLastError = true)]
public static extern bool InternetGetConnectedState(
   out uint lpdwFlags,
   uint dwReserved
);

Microsoft documentation: Link

Last updated