【发布时间】:2014-05-19 17:06:07
【问题描述】:
所以,我正在尝试编辑我从程序中打开的进程的一些选项。我希望能够转到 File->save as->... 之类的东西并将其保存为特定文件,或更改菜单栏中的其他一些选项。有没有办法使用流程类来做到这一点?这是我目前所拥有的:
try
{
string exe_path = @"C:\Program Files (x86)\My_Folder\My_Program.exe";
ProcessStartInfo ProgramInfo = new ProcessStartInfo(exe_path);
// Check that the path is valid before attempting to open there.
if (!File.Exists(exe_path))
return;
ProgramInfo.CreateNoWindow = true;
ProgramInfo.UseShellExecute = false;
ProgramInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process startProgram = Process.Start(ProgramInfo);
}
catch (Exception e)
{
SetFailureText("Found exception of type: " + e.ToString());
}
【问题讨论】:
-
你说的是自动化另一个程序(比如你想打开那个程序的文件菜单)?
-
是的,这正是我想要做的。
标签: c# process executable options