如题所示,windows 8 如何将string 类型转换成IStorageFile。
还有如何将文件保存到项目当前的某个目录下。
Hi,
string和IStorageFile我不认为有任何转换的办法。如果你string中保存的是一个文件地址,你可以使用比如StorageFile.GetFileFromPathAsync 打开文件,不过需要注意权限的问题。
保存到某个目录的话,你可以参考:
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/JJ150592(v=win.10).aspx
以及这个示例:
http://code.msdn.microsoft.com/windowsapps/File-access-sample-d723e597
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.