如何使用参数uwp启动.exe应用 [英] How to launch .exe app with parameter uwp
问题描述
我知道我们可以使用 LaunchFullTrustProcessFor 方法 和
I know we can use LaunchFullTrustProcessForCurrentAppAsync(String) method and
<desktop:Extension Category="windows.fullTrustProcess" Executable="fulltrustprocess.exe">
<desktop:FullTrustProcess>
<desktop:ParameterGroup GroupId="SyncGroup" Parameters="/Sync"/>
<desktop:ParameterGroup GroupId="OtherGroup" Parameters="/Other"/>
</desktop:FullTrustProcess>
启动并将参数发送到Win32应用程序.但是我最大的问题是:如何在我的win32应用程序中接收该参数(在我的情况下,win32应用程序是我的控制台应用程序).没有人有任何帮助.谢谢.
to launch and send parameter to win32 app. But my big question is: How to receive that parameter in my win32 app (in my case win32 app is my Console Application). Does anyone has any help. thank you.
更新Stefan答案
在win32应用程序中,始终具有 Main(string [] args),因此,如果另一个应用程序通过参数(例如:"my parameter"字符串)启动我们的win32 .exe,则 args 我确定,字符串数组将包含该我的参数"字符串.
Update for Stefan answer
in win32 app always have Main(string[] args), so if another app launch our win32 .exe with parameter (for example: "my parameter" string), args string array will contains that "my parameter" string, I sure that.
推荐答案
参数在Win32进程的Main()函数中作为参数传递.
The parameters are delivered as arguments in the Main() function of your Win32 process.
这篇关于如何使用参数uwp启动.exe应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!