using system.runtime.interopservices;
[dllimport("wininet.dll")]
private extern static bool internetgetconnectedstate(out int connectiondescription, int reservedvalue);
private static bool isconnected()
{
int i = 0;
bool state = internetgetconnectedstate(out i, 0);
return state;
}
static void main(string[] args)
{
console.writeline(isconnected().tostring());
}
新闻热点
疑难解答