询问者
???

问题
全部回复
-
Hi,
能提供给我代码吗?你是使用Windows.devices.portable 这个空间中的类进行通讯的吗?
或者你可以看一下这个例子:
http://code.msdn.microsoft.com/windowsapps/Removable-Storage-52cc49f0
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已编辑 Aaron XueModerator 2013年2月20日 6:14
-
做个测试吧,通过代码去拿到这个Removable Device上的文件,然后调用DeleteAsync. http://msdn.microsoft.com/en-us/library/windows/apps/hh465195.aspx 我个人不是很确定FilePicker 拿到的文件有这个删除和修改的权限。但依据文档http://msdn.microsoft.com/en-us/library/windows/apps/hh768221.aspx的说明,通过
Windows.Devices.Portable.StorageDevice.FromId拿到的Removable Device Storage 是可以操作删除和修改的。
Bob Bao
Do you still use the same Windows 8 LockScreen always? Download Chameleon Win8 App quickly, that changes your LockScreen constantly.
你是否还在看着一成不变的Windows 8锁屏而烦恼,赶紧下载这个 百变锁屏 应用,让你的锁屏不断地变化起来。 -
Hi,
从这个描述看似乎是By-design的,我会让更多的微软专家来帮助你。
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
若您用法administrator 权限运行程序,结果如何?
Regards,
Jenny
- 已编辑 JennyLi-MSFT 2013年3月12日 10:47
-
首先,检查一下文件的属性,是否是read only, 不同地方的文件都有严格的访问权限。
以及配置:
- Supports any file type. By checking this box, you are declaring that you could access any file type from your application.
- Supported file type. You can also specify which file types you want to open, so if your app only opens Excel files, for example, you could list “.xls” as your file type.
然后可以参考post:
http://lunarfrog.com/blog/2011/10/03/winrt-storage-overview/
http://lunarfrog.com/blog/2011/10/24/winrt-wps-part-2-searching-files-by-metadata/
http://stackoverflow.com/questions/14378709/why-cant-i-delete-files-when-my-app-is-suspending?rq=1
- 已编辑 JennyLi-MSFT 2013年3月12日 11:35
-
Hi,
这似乎是by-design的,你使用read权限去打开一个文件必然没有办法去写文件。但是换成readwrite权限的话,在写的时候文件肯定是需要被锁定的,防止不同的进程同时修改文件造成问题。我认为解决方法应该是修改你的程序,只有在需要写的时候使用readwrite权限,并且在写过后立刻释放掉stream,即相当关闭文件以便于之后再打开。
关闭流你可以使用DetachStream(),看看这个blog:
http://www.sharpgis.net/post/2012/01/12/Reading-and-Writing-text-files-in-Windows-8-Metro.aspx
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Hi,
具体是什么错误能有截图吗?
估计我也没有办法深入解释原理,原因是我没有办法看到源代码,资料也只是公开的文档。
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已编辑 Aaron XueModerator 2013年3月21日 7:34