StorageFolder.CreateFolderQueryWithOptions(QueryOptions) Method

Definition

Gets a query result object that contains the subfolders in the current folder and, optionally, nested subfolders. The results are based on the specified QueryOptions.

C#
public StorageFolderQueryResult CreateFolderQueryWithOptions(QueryOptions queryOptions);

Parameters

queryOptions
QueryOptions

The criteria that are applied to the query.

Returns

A query result object. Call the GetFoldersAsync method of the query result to get the subfolders in the current folder. If you provided a CommonFolderQuery value other than CommonFolderQuery.DefaultQuery when you instantiated the QueryOptions, the query result object contains a list of virtual folders that represent containers for groups of files in the subfolders of the current folder. (Files from the current folder are not included.) The files are grouped as specified by queryOptions. The list is of type IReadOnlyList<StorageFolder>. Each folder in the list is represented by a StorageFolder object.

Implements

Exceptions

You don't have permission to access the contents of the current folder.

Remarks

For more information and examples on getting query result objects, see CreateFileQueryWithOptions.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100