IStorageFolder IStorageFolder IStorageFolder IStorageFolder Interface

Manipulates folders and their contents, and provides information about them.

Important

If you simply want to work with folders in your app, see the StorageFolder class.

Syntax

Declaration

public interface IStorageFolderpublic interface IStorageFolderPublic Interface IStorageFolder

Inheritance Hierarchy

Methods summary

Creates a new file in the current folder.

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.

Creates a new folder in the current folder.

Creates a new folder in the current folder, and specifies what to do if a folder with the same name already exists in the current folder.

Gets the specified file from the current folder.

Gets the files from the current folder.

Gets the specified folder from the current folder.

Gets the folders in the current folder.

Gets the specified item from the IStorageFolder.

Gets the items from the current folder.

Methods

  • CreateFileAsync(System.String)
    CreateFileAsync(System.String)
    CreateFileAsync(System.String)
    CreateFileAsync(System.String)

    Creates a new file in the current folder.

    public IAsyncOperation<StorageFile> CreateFileAsync(System.String desiredName)public IAsyncOperation<StorageFile> CreateFileAsync(System.String desiredName)Public Function CreateFileAsync(desiredName As System.String) As IAsyncOperation( Of StorageFile )

    Parameters

    • desiredName
      System.String
      System.String
      System.String
      System.String

      The desired name of the file to create.

    Returns

    • When this method completes, it returns the new file as a StorageFile.

  • CreateFileAsync(System.String,Windows.Storage.CreationCollisionOption)
    CreateFileAsync(System.String,Windows.Storage.CreationCollisionOption)
    CreateFileAsync(System.String,Windows.Storage.CreationCollisionOption)
    CreateFileAsync(System.String,Windows.Storage.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.

    public IAsyncOperation<StorageFile> CreateFileAsync(System.String desiredName,Windows.Storage.CreationCollisionOption options)public IAsyncOperation<StorageFile> CreateFileAsync(System.String desiredName,Windows.Storage.CreationCollisionOption options)Public Function CreateFileAsync(desiredName As System.String,options As Windows.Storage.CreationCollisionOption) As IAsyncOperation( Of StorageFile )

    Parameters

    Returns

    • When this method completes, it returns the new file as a StorageFile.

  • CreateFolderAsync(System.String)
    CreateFolderAsync(System.String)
    CreateFolderAsync(System.String)
    CreateFolderAsync(System.String)

    Creates a new folder in the current folder.

    public IAsyncOperation<StorageFolder> CreateFolderAsync(System.String desiredName)public IAsyncOperation<StorageFolder> CreateFolderAsync(System.String desiredName)Public Function CreateFolderAsync(desiredName As System.String) As IAsyncOperation( Of StorageFolder )

    Parameters

    • desiredName
      System.String
      System.String
      System.String
      System.String

      The desired name of the folder to create.

    Returns

    • When this method completes, it returns the new folder as a StorageFolder.

  • CreateFolderAsync(System.String,Windows.Storage.CreationCollisionOption)
    CreateFolderAsync(System.String,Windows.Storage.CreationCollisionOption)
    CreateFolderAsync(System.String,Windows.Storage.CreationCollisionOption)
    CreateFolderAsync(System.String,Windows.Storage.CreationCollisionOption)

    Creates a new folder in the current folder, and specifies what to do if a folder with the same name already exists in the current folder.

    public IAsyncOperation<StorageFolder> CreateFolderAsync(System.String desiredName,Windows.Storage.CreationCollisionOption options)public IAsyncOperation<StorageFolder> CreateFolderAsync(System.String desiredName,Windows.Storage.CreationCollisionOption options)Public Function CreateFolderAsync(desiredName As System.String,options As Windows.Storage.CreationCollisionOption) As IAsyncOperation( Of StorageFolder )

    Parameters

    Returns

    • When this method completes, it returns the new folder as a StorageFolder.

  • GetFileAsync(System.String)
    GetFileAsync(System.String)
    GetFileAsync(System.String)
    GetFileAsync(System.String)

    Gets the specified file from the current folder.

    public IAsyncOperation<StorageFile> GetFileAsync(System.String name)public IAsyncOperation<StorageFile> GetFileAsync(System.String name)Public Function GetFileAsync(name As System.String) As IAsyncOperation( Of StorageFile )

    Parameters

    • name
      System.String
      System.String
      System.String
      System.String

      The name (or path relative to the current folder) of the file to retrieve.

    Returns

    • When this method completes successfully, it returns a StorageFile that represents the file.

  • GetFilesAsync()
    GetFilesAsync()
    GetFilesAsync()
    GetFilesAsync()

    Gets the files from the current folder.

    public IAsyncOperation<StorageFile>> GetFilesAsync()public IAsyncOperation<StorageFile>> GetFilesAsync()Public Function GetFilesAsync() As IAsyncOperation( Of StorageFile )

    Returns

    • When this method completes successfully, it returns a list of the files (type IVectorView<T> ) in the folder. Each file in the list is represented by a StorageFile object.

  • GetFolderAsync(System.String)
    GetFolderAsync(System.String)
    GetFolderAsync(System.String)
    GetFolderAsync(System.String)

    Gets the specified folder from the current folder.

    public IAsyncOperation<StorageFolder> GetFolderAsync(System.String name)public IAsyncOperation<StorageFolder> GetFolderAsync(System.String name)Public Function GetFolderAsync(name As System.String) As IAsyncOperation( Of StorageFolder )

    Parameters

    • name
      System.String
      System.String
      System.String
      System.String

      The name of the child folder to retrieve.

    Returns

    • When this method completes successfully, it returns a StorageFolder that represents the child folder.

  • GetFoldersAsync()
    GetFoldersAsync()
    GetFoldersAsync()
    GetFoldersAsync()

    Gets the folders in the current folder.

    public IAsyncOperation<StorageFolder>> GetFoldersAsync()public IAsyncOperation<StorageFolder>> GetFoldersAsync()Public Function GetFoldersAsync() As IAsyncOperation( Of StorageFolder )

    Returns

    • When this method completes successfully, it returns a list of the files (type IVectorView<T> ). Each folder in the list is represented by a StorageFolder.

  • GetItemAsync(System.String)
    GetItemAsync(System.String)
    GetItemAsync(System.String)
    GetItemAsync(System.String)

    Gets the specified item from the IStorageFolder.

    public IAsyncOperation<IStorageItem> GetItemAsync(System.String name)public IAsyncOperation<IStorageItem> GetItemAsync(System.String name)Public Function GetItemAsync(name As System.String) As IAsyncOperation( Of IStorageItem )

    Parameters

    • name
      System.String
      System.String
      System.String
      System.String

      The name of the item to retrieve.

    Returns

    • When this method completes successfully, it returns the file or folder (type IStorageItem ).

  • GetItemsAsync()
    GetItemsAsync()
    GetItemsAsync()
    GetItemsAsync()

    Gets the items from the current folder.

    public IAsyncOperation<IStorageItem>> GetItemsAsync()public IAsyncOperation<IStorageItem>> GetItemsAsync()Public Function GetItemsAsync() As IAsyncOperation( Of IStorageItem )

    Returns

    • When this method completes successfully, it returns a list of the files and folders (type IVectorView<T> ). The files and folders in the list are represented by objects of type IStorageItem.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Capabilities

picturesLibrary
videosLibrary
musicLibrary
documentsLibrary

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.GuidAttribute

Details

Assembly

Windows.Storage.dll