在地铁,什么是FolderInformation和StorageFolder之间的区别 [英] In metro, what's the difference between FolderInformation and StorageFolder
问题描述
FolderInformation
的方法/属性几乎相同与 StorageFolder
的。
我想不通为什么的WinRT API提供了 FolderInformation
和 StorageFolder
为好。如果我给你从创建的列表FileInformationFactory.GetFoldersAsync()
到的ItemsControl
,它从上市创造不同 StorageFolder.CreateFolderAsync()
?
该文件说, FolderInformation
提供同步访问,但我不知道什么时候这个问题会发生。
FolderInformation
's methods/properties are nearly the same with StorageFolder
's.
I can't figure out why WinRT api provides FolderInformation
and StorageFolder
as well. If I assign the list created from FileInformationFactory.GetFoldersAsync()
to an ItemsControl
, does it differ from the listed created from StorageFolder.CreateFolderAsync()
?
The document says the FolderInformation
provides synchronous access, but I don't know when the issue would happen.
有一个缺点我在 FolderInformation
发现的是它只能从 FileInformationFactory
创建。所以,我认为这是不可能创建一个 FolderInformation
为 KnownFolders.PicturesLibrary
。
The one drawback I found in FolderInformation
is it could only be created from FileInformationFactory
. So I think it's impossible to create a FolderInformation
for the KnownFolders.PicturesLibrary
.
推荐答案
FolderInformation,您可以作用于文件夹本身(如移动,删除,重命名它等) <一href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.bulkaccess.folderinformation.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.bulkaccess.folderinformation.aspx
FolderInformation lets you act on the Folder itself (as in move it, delete it, rename it etc.) http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.bulkaccess.folderinformation.aspx
而StorageFolder,您可以作用于文件夹的内容(如在文件夹中创建一个新的文件,创建一个新的子文件夹中的文件夹中,您可以通过文件夹等所有文件) 的http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefolder.aspx
Whereas StorageFolder lets you act on the contents of the folder (as in create a new file in the folder, create a new sub-folder in the folder, get all the files from the folder etc.) http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefolder.aspx
这篇关于在地铁,什么是FolderInformation和StorageFolder之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!