图的参数时,WPF形式使用Process类开始 [英] Figure the arguments when wpf form is started using Process Class

查看:441
本文介绍了图的参数时,WPF形式使用Process类开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用此code推出WPF形式:

We are using this code to launch a Wpf form:

string fileName = @"C:\Test\bin\Debug\WpfTest.exe";
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(fileName);
            psi.Arguments = entryZfName;
            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo = psi;
            p.Start();

该WpfTest是含有被推出了WPFForm1.xaml的appliation。
如何访问这个形式是在上述code设定为PSI的参数。
他们是在构造函数中访问?
另外如何调试这种情况下,换句话说,因为我直接从code我不能够调试或访问code发动wpftest.exe,是否有可能调试此。让我知道如果你需要更多的信息。

The WpfTest is an appliation which contain a WPFForm1.xaml which gets launched. How to access the arguments in this form that were set to psi in the above code. Are they accessible in the constructor? Also how to debug this scenario, in other words since i am launching the wpftest.exe directly from the code i am not able to debug or access the code, is it possible to debug this. Let me know if you need more info

推荐答案

您可以使用Environment.GetCommandLineArgs得到ARGS。要调试你可以在WPF形式或者你想如果你有机会到code开始调试的地方添加Debug.Launch()。

you can use Environment.GetCommandLineArgs to get args. To Debug you can add Debug.Launch() in the wpf form or the place you want to start debugging if you have access to the code..

这篇关于图的参数时,WPF形式使用Process类开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆