我试图从另一个wpf应用程序调用一个wpf应用程序.调用wpf应用程序进行调用
ProcessStartInfo BOM = new ProcessStartInfo();
BOM.FileName = @"D:\WPFAPPLICATION.exe";
BOM.Arguments = temp;
Process.Start(BOM);
Run Code Online (Sandbox Code Playgroud)
现在在调用的应用程序中,我尝试检索传递的参数
string arguments =Process.GetCurrentProcess().StartInfo.Arguments;
Run Code Online (Sandbox Code Playgroud)
但是参数没有通过.为什么是这样??
我还尝试了一种替代方法,其中:
public partial class App : Application
{
public static String[] mArgs;
private void Application_Startup(object sender, StartupEventArgs e)
{
if (e.Args.Length > 0)
{
mArgs = e.Args;
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
然而,这也不起作用!请帮忙!!