Example #1
0
        public override void Redial()
        {
#if !NET_CORE
            Adsl ras = new Adsl();
            ras.Disconnect();            //断开连接
            ras.Connect(Interface);      //重新拨号
#else
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                Process process = Process.Start("adsl-stop");
                process.WaitForExit();
                process = Process.Start("adsl-start");
                process.WaitForExit();
            }
#endif
        }
Example #2
0
        private void Process()
        {
            IProcess       processHandler = new ProcessHandler();
            IConfiguration configuration  = new ConfigurationHelper();

            while (true)
            {
                processHandler.Process(exception =>
                {
                    WriteLog writeLog = new WriteLog();
                    writeLog.WriteDirectly(this, new ExceptionEventArgs(exception?.Message, exception));
                    //Environment.Exit(1);
                }, () =>
                {
                    //Adsl.Connect(configuration.GetConnectName(), configuration.GetUserName(), configuration.GetPassword());
                    Adsl.Connect(configuration.GetConnectName());
                });

                Console.WriteLine("暂停2分钟后取任务");
                Thread.Sleep(TimeSpan.FromMinutes(2));
            }
        }