InternetCheckConnection

[DllImport("wininet.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool InternetCheckConnection(
   string lpszUrl,
   uint dwFlags,
   uint dwReserved
);

Microsoft documentation: Link

Last updated