C# Process调用应用程序失败时应注意的问题

 C#中如果采用Process调用应用程序失败,请添加下列第一行,设置应用程序所在的路径。                  

 

        Directory.SetCurrentDirectory([应用程序所在路径]);
                    Process process = new Process();
                    process.StartInfo.FileName = [应用程序名称];
                    process.StartInfo.Arguments = [调用参数];
                    process.StartInfo.UseShellExecute = false;
                    process.StartInfo.CreateNoWindow = true;
                    process.Start();
                    process.WaitForExit();

posted on 2011-03-22 11:07  网际浪人  阅读(1381)  评论(0编辑  收藏  举报