Esempio n. 1
0
        public override void Redial()
        {
#if !NET_CORE
            RasDisplay ras = new RasDisplay();
            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
        }
Esempio n. 2
0
        public override void Redial()
        {
#if !NET_CORE
            Console.WriteLine($"Try to redial: {Interface} {User} {Password}");
            RasDisplay ras = new RasDisplay();
            ras.Disconnect();            //断开连接
            ras.Connect(Interface);      //重新拨号
#else
            Log.WriteLine($"Try to redial: {Interface} {User} {Password}");
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                Process process = Process.Start("adsl-stop");
                process.WaitForExit();
                process = Process.Start("adsl-start");
                process.WaitForExit();
            }
#endif
        }