EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

StorageFolder.GetFilesAsync | getFilesAsync methods

Gets the files in the current folder. Some options also return the files in the subfolders of the current folder.

Overload list

MethodDescription
GetFilesAsync() Gets the files in the current folder.
GetFilesAsync(CommonFileQuery) Gets the files in the current folder. Also gets the files from the subfolders of the current folder when the value of the query argument is something other than CommonFileQuery.DefaultQuery. Files are sorted based on the specified value from the CommonFileQuery enumeration.
GetFilesAsync(CommonFileQuery, UInt32, UInt32) Gets an index-based range of files from the list of all files in the current folder. Also gets the files from the subfolders of the current folder when the value of the query argument is something other than CommonFileQuery.DefaultQuery. Files are sorted based on the specified value from the CommonFileQuery enumeration.

Remarks

The following table lists methods of the StorageFolder class that get a list of files. The table identifies shallow queries that only return files from the current folder, and deep queries that return files from the current folder and from its subfolders.

Some methods take a value from the CommonFileQuery enumeration. When you specify the DefaultQuery option from the CommonFileQuery enumeration, the query is a shallow query that returns only files in the current folder. When you specify another value from the CommonFileQuery enumeration, the query is a deep query that returns a flattened list of files from the current folder and from its subfolders.

Note  

Some of the values from the CommonFileQuery enumeration can only be used with a library folder (such as the Pictures library) or the Homegroup folder. In addition to the DefaultQuery option, you can use only the OrderByName and OrderBySearchRank options with a folder that's not a library folder.

To get deep query results from a folder that's not a library folder, call the CreateFileQueryWithOptions(QueryOptions) method and specify Deep as the value of the FolderDepth property of the QueryOptions object.

MethodCreate a shallow query that only returns files from the current folderCreate a deep query that returns files from the current folder and from its subfolders
GetFilesAsync() Default behavior of this method.N/a
GetFilesAsync(CommonFileQuery) Specify the DefaultQuery option.For a library folder, specify an option other than DefaultQuery.
GetFilesAsync(CommonFileQuery, UInt32, UInt32) Specify the DefaultQuery option.For a library folder, specify an option other than DefaultQuery.
CreateFileQuery() Default behavior of this method.N/a
CreateFileQuery(CommonFileQuery) Specify the DefaultQuery option.For a library folder, specify an option other than DefaultQuery.
CreateFileQueryWithOptions(QueryOptions)
  • Default behavior of this method if none of the following options are specified.

    - or -

  • Specify DefaultQuery as the value of CommonFileQuery when you instantiate the QueryOptions object.

    - or -

  • Specify Shallow as the value of the FolderDepth property of the QueryOptions object.

 

To get items that are files or folders, call the GetItemsAsync method.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

See also

StorageFolder
GetItemsAsync

 

 

Mostrar:
© 2015 Microsoft