using System;
using System.Runtime.InteropServices;

namespace MyAssist
{
    /// <summary>
    /// netstat 的摘要说明。
    /// </summary>
    public class netstat
    {
        [DllImport("wininet.dll")]
        private extern static bool InternetGetConnectedState(out int connectionDescription,
            int reservedValue);

        public bool IsConnected()
        {
            int I = 0;
            bool state = InternetGetConnectedState(out I, 0);
            return state;
        }
    }
}
posted on 2007-02-04 00:19  kingeric  阅读(355)  评论(0编辑  收藏  举报