Beispiel #1
0
        /// <summary>
        /// 自动重拨,无需密码
        /// </summary>
        public static void ReConn2()
        {
            var    lines   = File.ReadAllLines("config//adslconfig.txt");
            string name    = lines[0];
            string pwd     = lines[1];
            int    seconds = Convert.ToInt32(lines[2]); //6
            int    time    = Convert.ToInt32(lines[3]); //5

            cRASDisplay cRas = new cRASDisplay();

            LogManager.WriteLog("当前连接状态" + cRas.IsConnected);
            bool ipisok = false;

            if (cRas.IsConnected)
            {
                cRas.Disconnect();
                LogManager.WriteLog("Disconnect");
            }
            do
            {
                AdslConn(cRas, seconds, time);
                string key = RasApi.GetIP("宽带连接");
                LogManager.WriteLog("ip =" + key);
                ipisok = checkIpisOKBylocal(key);
            } while (!ipisok);

            LogManager.WriteLog(cRas.Duration);
        }
Beispiel #2
0
        public static void ReConn()
        {
            var    lines   = File.ReadAllLines("config//adslconfig.txt");
            string name    = lines[0];
            string pwd     = lines[1];
            int    seconds = Convert.ToInt32(lines[2]); //6
            int    time    = Convert.ToInt32(lines[3]); //5


            Common.ADSL1.cRASDisplay cRas = new cRASDisplay();
            //   LogManager.WriteLog("当前连接状态" + cRas.IsConnected);
            if (cRas.IsConnected)
            {
                cRas.Disconnect();
                //      LogManager.WriteLog("Disconnect");
                Thread.Sleep(5000);
                cRas.Connect("宽带连接");
                AdslConn(cRas, seconds, time);
            }
            else
            {
                AdslConn(cRas, seconds, time);
            }
        }