使用Windows 8获取资产文件夹并在资产文件夹中创建一个文件夹,并在创建文件夹中创建一个文件 [英] Get Assets Folder and create a Folder in Assets Folder and create a file in create Folder using windows 8

查看:101
本文介绍了使用Windows 8获取资产文件夹并在资产文件夹中创建一个文件夹,并在创建文件夹中创建一个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

StorageFolder InstallationFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;
StorageFile file = await InstallationFolder.CreateFileAsync("MyDocument.Txt", CreationCollisionOption.ReplaceExisting);
await FileIO.WriteTextAsync(file, "Hello");



错误是:

mscorlib.dll中发生类型为"System.UnauthorizedAccessException"的异常,但未在用户代码中处理
附加信息:访问被拒绝. (来自HRESULT的异常:0x80070005(E_ACCESSDENIED))
如果存在用于此异常的处理程序,则可以安全地继续执行该程序.



The error is:

An exception of type ''System.UnauthorizedAccessException'' occurred in mscorlib.dll but was not handled in user code
Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
If there is a handler for this exception, the program may be safely continued.

推荐答案

正如您可以在http://msdn.microsoft.com/en-us/library/windows/apps/hh967755.aspx [ ^ ]:

该应用程序的安装目录是只读位置.
As you can read in the MSDN documentation available at http://msdn.microsoft.com/en-us/library/windows/apps/hh967755.aspx[^]:

The app''s install directory is a read-only location.


这篇关于使用Windows 8获取资产文件夹并在资产文件夹中创建一个文件夹,并在创建文件夹中创建一个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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