【发布时间】:2019-12-27 08:27:15
【问题描述】:
没有错误,什么也没发生,文件目标仍然在我的路径中
public void keyboard(){
ProcessStartInfo touchkey = new ProcessStartInfo(@"C:\Program
Files\Common Files\microsoft shared\ink\TabTip.exe");
touchkey.WorkingDirectory = @"C:\";
touchkey.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(touchkey);
}
更新
The suggested solution threw a `UnauthorizedAccessException`:
var path = @"ms-appx://C:/Program Files/Common Files/microsoft
shared/ink/TabTip.exe";
var file = await
Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(path); 等待 Windows.System.Launcher.LaunchFileAsync(file);
更新2
我尝试使用 FullTrustProcessLauncher 它工作正常,但就像键盘 tabtip.exe 之前的代码不显示我不知道我应该做什么
await Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
{
FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
});
【问题讨论】: