Files
2026-07-10 15:25:05 +08:00

21 lines
512 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace Zhaizj.Framework.Utils
{
public class WebState
{
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue);
public static bool IsInternetConnected()
{
int i = 0;
bool state = InternetGetConnectedState(out i, 0);
return state;
}
}
}