IStorageFolder 介面

定義

操作資料夾及其內容,並提供其相關資訊。

重要

如果您只是想要在應用程式中使用資料夾,請參閱 StorageFolder 類別。

public interface class IStorageFolder : IStorageItem
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(1926351736, 46063, 20341, 168, 11, 111, 217, 218, 226, 148, 75)]
struct IStorageFolder : IStorageItem
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(1926351736, 46063, 20341, 168, 11, 111, 217, 218, 226, 148, 75)]
public interface IStorageFolder : IStorageItem
Public Interface IStorageFolder
Implements IStorageItem
衍生
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)
應用程式功能
documentsLibrary musicLibrary picturesLibrary videosLibrary

屬性

Attributes

取得儲存體專案的屬性。

(繼承來源 IStorageItem)
DateCreated

取得建立目前專案的日期和時間。

(繼承來源 IStorageItem)
Name

取得包含副檔名的專案名稱,如果有的話。

(繼承來源 IStorageItem)
Path

如果專案具有路徑,則取得專案的完整檔案系統路徑。

(繼承來源 IStorageItem)

方法

CreateFileAsync(String)

在目前資料夾中建立新的檔案。

CreateFileAsync(String, CreationCollisionOption)

在目前資料夾中建立新的檔案,並指定如果同名的檔案已存在於目前資料夾中,該怎麼辦。

CreateFolderAsync(String)

在目前資料夾中建立新的資料夾。

CreateFolderAsync(String, CreationCollisionOption)

在目前資料夾中建立新的資料夾,並指定如果目前資料夾中已有相同名稱的資料夾,該怎麼辦。

DeleteAsync()

刪除目前的專案。

(繼承來源 IStorageItem)
DeleteAsync(StorageDeleteOption)

刪除目前的專案,並選擇性地永久刪除它。

(繼承來源 IStorageItem)
GetBasicPropertiesAsync()

取得目前專案的基本屬性 (,例如檔案或資料夾) 。

(繼承來源 IStorageItem)
GetFileAsync(String)

從目前資料夾取得指定的檔案。

GetFilesAsync()

從目前資料夾取得檔案。

GetFolderAsync(String)

從目前資料夾取得指定的資料夾。

GetFoldersAsync()

取得目前資料夾中的資料夾。

GetItemAsync(String)

IStorageFolder取得指定的專案。

GetItemsAsync()

從目前資料夾取得專案。

IsOfType(StorageItemTypes)

判斷目前的 IStorageItem 是否符合指定的 StorageItemTypes 值。

(繼承來源 IStorageItem)
RenameAsync(String)

重新命名目前的專案。

(繼承來源 IStorageItem)
RenameAsync(String, NameCollisionOption)

重新命名目前的專案。 如果目前專案位置中的現有專案具有相同的名稱,這個方法也會指定該怎麼做。

(繼承來源 IStorageItem)

適用於

另請參閱