asp.net实现检测电脑是否正确|asp.net实现检测电脑是否联网api程序

更新时间:2018-07-08    来源:php常用代码    手机版     字体:

【www.bbyears.com--php常用代码】

 代码如下

 

::Wininet := ..raw.loadDll("Wininet.dll") 
::InternetGetConnectedState = Wininet.api("InternetGetConnectedState","bool(int &flag,int

reserved )" )
 
isOnline = function(){
    return InternetGetConnectedState(0,0); 
}
 
io.open()
io.print( isOnline() )


using System.Runtime.InteropServices;
class inet
{
    [DllImport("wininet.dll")]
    extern static bool InternetGetConnectedState(out int connectionDescription, int

reservedValue);
    public bool isOnline()
    {
        int flag = 0;
        bool state = InternetGetConnectedState(out flag, 0);
        return state;
    }
}

本文来源:http://www.bbyears.com/jiaocheng/42707.html