1

我想用c#连接/断开宽带连接

  string[] lines = System.IO.File.ReadAllLines(Path);
       // System.Windows.Forms.MessageBox.Show(lines[0] + "  " + lines[1] + "  " + lines[2]);
        System.Diagnostics.Process process = new System.Diagnostics.Process();
        System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
        startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
        startInfo.FileName = "cmd.exe";
        startInfo.Arguments = string.Format("/c rasdial {0} {1} {2}",lines[2]  , lines[0]  , lines[1]);        
        process.StartInfo = startInfo;
        process.Start();
4

0 回答 0