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

 

posted @ 2019-01-17 12:31  zhaogaojian  阅读(715)  评论(0编辑  收藏  举报