c#根据文件路径启动进程

       //根据文件路径启动进程
        private static void StartProcessByFilePath(string path)
        {
            Process p = new System.Diagnostics.Process();
            p.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(path);
            p.StartInfo.FileName = System.IO.Path.GetFileName(path);
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardInput = false;
            p.StartInfo.RedirectStandardOutput = false;
            p.StartInfo.RedirectStandardError = false;
            p.StartInfo.CreateNoWindow = true;
            Process.Start(path);
        }

猜你喜欢

转载自www.cnblogs.com/zhaogaojian/p/10281604.html