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