ping 服务端

using System;
using System.Runtime;
using System.Runtime.InteropServices;
public static class InternetConnectionStatus
{
    [DllImport("wininet.dll")]
    private extern static bool InternetGetConnectedState(out int Description, int Reserved);
    public static bool Connected()
    {
        int Descript;
        return InternetGetConnectedState(out Descript, 0);
    }
}
posted on 2011-12-08 08:43  武胜-阿伟  阅读(255)  评论(0编辑  收藏  举报