使用桌面桥创建的UWP App时,[UWP] [桌面桥]文件访问被拒绝错误 [英] [UWP][Desktop Bridge]File Access Denied Error with UWP App created using Desktop Bridge

查看:154
本文介绍了使用桌面桥创建的UWP App时,[UWP] [桌面桥]文件访问被拒绝错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Desktop Bridge将我现有的.Net应用程序之一转换为UWP。转换成功并安装它,但在启动UWP应用程序时,出现访问被拒绝访问文件的错误。实际上在我原来的.Net应用程序中,
安装路径有一些配置文件而.Net应用程序使用该文件,在.Net应用程序中我使用"Path.Combine()","File.Open( )"用于访问文件的函数。我是UWP的新手,桌面
Bridge不支持这种情况吗?请指导我前进的路径。

Hi, I am using Desktop Bridge to convert one of my existing .Net application to UWP. The conversion got success and installed it, but while launching the UWP application, got error that access denied to access a file. Actually in my original .Net application, the installed path has some configuration file and the .Net application uses that file, inside .Net application I use "Path.Combine()", "File.Open()" functions to access the file. I am new to UWP, whether this case is not supported in Desktop Bridge?, please guide me path to proceed forward.




推荐答案

Hi Perumal,

Hi Perumal,

>>"桌面桥是否支持此案例?"

>>"whether this case is not supported in Desktop Bridge?"

是的。 UWP不支持它。您可以使用
存储API
从已安装的配置文件中获取包。 

Yes. It’s not supported in UWP. You could use the Storage APIs to get the configuration file from your installed package. 

例如:

StorageFile folder = await Package.Current.InstalledLocation.GetFileAsync("configurefile");

此外,如果您想了解更多有关此内容的详细信息。您可以阅读Rob的博客" Skip
路径:坚持使用StorageFile
"。他解释得非常详细。 

Besides, if you want to know more detailed information about this. You could read Rob’s blog about "Skip the path: stick to the StorageFile". He has explained very detailed. 

最好的问候,

Xavier Eoro


这篇关于使用桌面桥创建的UWP App时,[UWP] [桌面桥]文件访问被拒绝错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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