2025-03-28 09:49:56 +08:00

22 lines
523 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace ConnectPoint
{
class NetWork
{
//检测网络状态
[DllImport("wininet.dll", EntryPoint = "InternetGetConnectedState")]
public extern static bool InternetGetConnectedState(out int conState, int reder);
public static bool jiance()
{
int Desc = 0;
return InternetGetConnectedState(out Desc, 0);
}
}
}