Passing in Command Line Arguments to C# .NET app Without Using Manifest File Inside a UWP App
For your requirement, you could pass the launcher parameter with LocalSettings
. Store the parameter in the UWP client and retrieve value from launcher, then call process start with retrieved paramete.
For example
UWP Client
private async void btnClick_Parameters(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
{
// store command line parameters in local settings
// so the Lancher can retrieve them and pass them on
ApplicationData.Current.LocalSettings.Values["parameters"] = "command parameter";
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("Parameters");
}
}
Launcher
string parameters = ApplicationData.Current.LocalSettings.Values["parameters"] as string;
Process newProcess = Process.Start(rootPath + @"WPFWPF.exe", parameters);
For more detail please refer stanfen's blog UWP with Desktop Extension – Part 2
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…