Windows 8中的StorageFolder [英] StorageFolder in windows 8

查看:130
本文介绍了Windows 8中的StorageFolder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

StorageFolder storageFolder =等待StorageFolder.GetFolderFromPathAsync(path);

路径是字符串,例如c:\\ myImages \\ wedding
我无法使用指定的代码获取文件夹..
出现错误访问被拒绝"?
请帮帮我



我也想获取指定路径文件夹中的所有图像文件吗?
IAsyncOperation<存储文件> fileList = StorageFile.GetFileFromPathAsync(path);
这没有为我提供任何解决方案......

StorageFolder storageFolder = await StorageFolder.GetFolderFromPathAsync(path);

path is string for example c:\\myImages\\wedding
i am not able to fetch the folder using the specified code..??
getting error "Access is Denied"??
please help me out



also i want to fetch all the image files in specified path folder?
IAsyncOperation<storagefile> fileList = StorageFile.GetFileFromPathAsync(path);
this isn''t providing me any solution......

推荐答案

这不是很明显吗?您的应用程序没有足够的特权来访问文件.路径名"c:\ myImages \ wedding"(不是"c:\\ myImages \\ wedding"!)通常是用户模式下的非法路径.当然,用户始终可以以管理员身份运行您的应用程序,或更改某些对象的文件系统权限,但这并不是正确的方法.相反,您应该为工作使用合法目录,为每个用户的所有用户"帐户预定义的目录.

—SA
Isn''t this obvious? Your application does not have enough privileges to access the file. The path name "c:\myImages\wedding" (not "c:\\myImages\\wedding"!) is normally illegal path for the user mode. Of course, the user can always run your application as administrator, or change the file system permission for some object, but this is just not right way of doing things. Rather, you should use legal directories for your work, those predefined for each user''s account of for "all users".

—SA


这篇关于Windows 8中的StorageFolder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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