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);
    }
}

你可能感兴趣的:(ping)