エクスポート (0) 印刷
すべて展開
情報
要求されたトピックは次のとおりです。しかし、このトピックはこのライブラリには含まれていません。

StorageFolder Class

フォルダーとその内容を操作し、その情報を提供します。

構文


public ref class StorageFolder sealed : IStorageFolder,
    IStorageItem,
    IStorageFolderQueryOperations,
    IStorageItemProperties,
    IStorageItemProperties2,
    IStorageItem2,
    IStorageFolder2,
    IStorageItemPropertiesWithProvider

属性

[Version(0x06020000)]

メンバー

StorageFolderクラス には次の種類のメンバーが含まれます:

メソッド

The StorageFolder クラス には次のメソッドがあります。C#、Visual Basic、C++ では、次のもののメソッドも継承しますObject クラス.

メソッド説明
AreQueryOptionsSupported Determines whether the current folder supports the specified QueryOptions.
CreateFileAsync(String) Creates a new file in the folder or file group.
CreateFileAsync(String, CreationCollisionOption) Creates a new file in the current folder, and specifies what to do if a file with the same name already exists in the current folder.
CreateFileQuery() Creates a query result object to filter and enumerate top-level files in the current folder.
CreateFileQuery(CommonFileQuery) Creates a query result object to filter and enumerate all the files in the current folder and its subfolders. Files are filtered and sorted based on the specified CommonFileQuery.
CreateFileQueryWithOptions Creates a query result object to filter and enumerate the files in the current folder and its subfolders. Files are included in the query result and sorted based on the specified QueryOptions.
CreateFolderAsync(String) Creates a new subfolder inside the current folder.
CreateFolderAsync(String, CreationCollisionOption) Creates a new sub-folder inside the current folder, and specifies what to do if a folder with the same name already exists in the current folder.
CreateFolderQuery() Creates a query result object to filter and enumerate top-level sub-folders of the current folder.
CreateFolderQuery(CommonFolderQuery) Creates a query result object to enumerate files in the current folder by grouping them into StorageFolder objects. Files are filtered and grouped based on the specified CommonFolderQuery.
CreateFolderQueryWithOptions Creates a query result object to filter and enumerate files in the current folder by grouping them into sub-folders. Files are included in the query result and grouped into sub-folders based on the specified QueryOptions.
CreateItemQuery Creates a query result object to filter and enumerate top-level items (files and sub-folders) in the current folder.
CreateItemQueryWithOptions Creates a query result object to filter and enumerate top-level items (files and sub-folders) in the current folder. Items are included in the query result and sorted based on the specified QueryOptions.
DeleteAsync() Deletes the current folder or file group.
DeleteAsync(StorageDeleteOption) Deletes the current folder or file group, optionally deleting it permanently.
GetBasicPropertiesAsync Gets the basic properties of the current folder or file group.
GetFileAsync Gets a single file from the current folder using the specified file name.
GetFilesAsync() Gets the top-level files in the current folder.
GetFilesAsync(CommonFileQuery) Gets a list of all files in the current folder and its sub-folders. Files are filtered and sorted based on the specified CommonFileQuery.
GetFilesAsync(CommonFileQuery, UInt32, UInt32) Gets an index-based range of files from the list of all files in the current the current folder and its sub-folders. Files are filtered and sorted based on the specified CommonFileQuery and are included in the range based on the resulting indexes.
GetFolderAsync Gets a single sub-folder from the current folder using the specified folder name.
GetFolderFromPathAsync Gets a StorageFolder that represents the folder at the specified file-system path.
GetFoldersAsync() Gets a list of the top-level sub-folders of the current folder.
GetFoldersAsync(CommonFolderQuery) Gets a list of StorageFolder objects that represent groups of files in the current folder. Files are filtered and grouped based on the specified CommonFolderQuery.
GetFoldersAsync(CommonFolderQuery, UInt32, UInt32) Gets an index-based range of StorageFolder objects that represent groups of files in the current folder. Files are filtered and grouped based on the specified CommonFolderQuery and are included in the range based on the resulting indexes.
GetIndexedStateAsync Gets the indexed state of the current folder.
GetItemAsync Gets a single file or sub-folder from the current folder using the name of the item.
GetItemsAsync() Gets a list of top-level files and sub-folders inside the current folder.
GetItemsAsync(UInt32, UInt32) Gets an index-based range from a list of all the files and sub-folders inside the current folder. Items in the range based on the resulting indexes.
GetParentAsync Gets the parent folder of the current folder.
GetScaledImageAsThumbnailAsync(ThumbnailMode) Gets a scaled image as a thumbnail, determined by the purpose of the thumbnail.
GetScaledImageAsThumbnailAsync(ThumbnailMode, UInt32) Gets a scaled image as a thumbnail, determined by the purpose of the thumbnail and the requested size.
GetScaledImageAsThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) Gets a scaled image as a thumbnail, determined by the purpose of the thumbnail, the requested size, and the specified options
GetThumbnailAsync(ThumbnailMode) Gets an adjusted thumbnail image for the current folder, determined by the specified purpose of the thumbnail.
GetThumbnailAsync(ThumbnailMode, UInt32) Gets an adjusted thumbnail image for the current folder, determined by the specified purpose of the thumbnail and the requested size.
GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) Gets an adjusted thumbnail image for the current folder, determined by the specified purpose of the thumbnail, the requested size, and the specified options.
IsCommonFileQuerySupported Indicates whether the current folder supports the specified CommonFileQuery.
IsCommonFolderQuerySupported Indicates whether the current folder supports the specified CommonFolderQuery.
IsEqual Indicates whether the current folder is equal to the specified folder.
IsOfType Indicates whether the current StorageFolder matches the specified StorageItemTypes value.
RenameAsync(String) Renames the current folder.
RenameAsync(String, NameCollisionOption) Renames the current folder and specifies what to do if a folder with the same name already exists.
TryGetItemAsync Try to get a single file or sub-folder from the current folder by using the name of the item.

 

プロパティ

StorageFolderクラス次のプロパティがあります。

プロパティアクセスの種類説明

Attributes

読み取り専用Gets the attributes of the current folder.

DateCreated

読み取り専用Gets the date and time that the current folder was created.

DisplayName

読み取り専用Gets the user-friendly name of the current folder.

DisplayType

読み取り専用Gets the user-friendly type of the folder or file group.

FolderRelativeId

読み取り専用Gets an identifier for the current folder. This ID is unique for the query result or StorageFolder that contains the current folder or file group, and can be used to distinguish between items that have the same name.

Name

読み取り専用Gets the name of the current folder.

Path

読み取り専用Gets the full file-system path of the current folder, if the folder has a path.

Properties

読み取り専用Gets an object that provides access to the content-related properties of the current folder.

Provider

読み取り専用Gets the StorageProvider object that contains info about the service that stores the current folder.

 

注釈

通常、非同期メソッドまたは関数呼び出しの結果として StorageFolder オブジェクトにアクセスします。たとえば、静的メソッド GetFolderFromPathAsync は、指定したフォルダーを示す StorageFolder を返します。

また、ファイル ピッカーを呼び出してフォルダーを選択した場合、ピッカーは常に StorageFolder としてフォルダーを返します。

この例は、FolderPicker.PickSingleFolderAsync を使用してファイル ピッカーを呼び出し、ユーザーが選択するファイルをキャプチャして処理する方法を示しています。

現在、コード例がないか、この言語はサポートされていません。

PickSingleFileAsync が完了すると、folder は、選択ファイルを StorageFolder として取得します。

例では、folderPickerFolderPicker オブジェクトが含まれます。ファイル ピッカーの使用方法の詳細については、「FolderPicker」と「クイックスタート: ファイル ピッカーによるファイルへのアクセス」を参照してください。

また、folderTokenFutureAccessList からフォルダーを取得するために使用できる識別子を取得します。後でアクセスできるようにファイルおよびフォルダーを保存することに関する詳細については、「FutureAccessList」、「MostRecentlyUsedList」、「How to track recently used files and folders (最近使用されたファイルとフォルダーの追跡方法)」を参照してください。

要件

サポートされている最小のクライアント

Windows 8 [Windows ストア アプリのみ]

サポートされている最小のサーバー

Windows Server 2012 [Windows ストア アプリのみ]

サポートされている最小の電話

Windows Phone 8

名前空間

Windows.Storage
Windows::Storage [C++]

メタデータ

Windows.winmd

Capabilities

picturesLibrary
videosLibrary
musicLibrary
documentsLibrary

参照

StorageFile

 

 

表示:
© 2015 Microsoft