在地铁,什么是FolderInformation和StorageFolder之间的区别地铁、区别、FolderInformation、StorageFolder

2023-09-05 04:13:34 作者:再無賴也只是個男人。

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,您可以作用于文件夹本身(如移动,删除,重命名它等) 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