IStorageFolder IStorageFolder IStorageFolder Interface

Definition

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.

public interface IStorageFolderpublic interface IStorageFolderPublic Interface IStorageFolder
Inheritance
IStorageFolderIStorageFolderIStorageFolder
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
documentsLibrary musicLibrary videosLibrary picturesLibrary

Inherited Members

Inherited properties

Inherited methods

Methods

CreateFileAsync(String) CreateFileAsync(String) CreateFileAsync(String)

Creates a new file in the current folder.

public IAsyncOperation<StorageFile> CreateFileAsync(String desiredName)public IAsyncOperation<StorageFile> CreateFileAsync(String desiredName)Public Function CreateFileAsync(desiredName As String) As IAsyncOperation( Of StorageFile )
Parameters
desiredName
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.

Attributes

CreateFileAsync(String, CreationCollisionOption) CreateFileAsync(String, CreationCollisionOption) 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.

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

The desired name of the file to create.

If there is an existing file in the current folder that already has the specified desiredName, the specified CreationCollisionOption determines how Windows responds to the conflict.

options
CreationCollisionOption CreationCollisionOption CreationCollisionOption

The enum value that determines how Windows responds if the desiredName is the same as the name of an existing file in the current folder.

Returns

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

Attributes

CreateFolderAsync(String) CreateFolderAsync(String) CreateFolderAsync(String)

Creates a new folder in the current folder.

public IAsyncOperation<StorageFolder> CreateFolderAsync(String desiredName)public IAsyncOperation<StorageFolder> CreateFolderAsync(String desiredName)Public Function CreateFolderAsync(desiredName As String) As IAsyncOperation( Of StorageFolder )
Parameters
desiredName
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.

Attributes

CreateFolderAsync(String, CreationCollisionOption) CreateFolderAsync(String, CreationCollisionOption) CreateFolderAsync(String, 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(String desiredName, CreationCollisionOption options)public IAsyncOperation<StorageFolder> CreateFolderAsync(String desiredName, CreationCollisionOption options)Public Function CreateFolderAsync(desiredName As String, options As CreationCollisionOption) As IAsyncOperation( Of StorageFolder )
Parameters
desiredName
System.String System.String System.String

The desired name of the folder to create.

If there is an existing folder in the current folder that already has the specified desiredName, the specified CreationCollisionOption determines how Windows responds to the conflict.

options
CreationCollisionOption CreationCollisionOption CreationCollisionOption

The enum value that determines how Windows responds if the desiredName is the same as the name of an existing folder in the current folder.

Returns

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

Attributes

GetFileAsync(String) GetFileAsync(String) GetFileAsync(String)

Gets the specified file from the current folder.

public IAsyncOperation<StorageFile> GetFileAsync(String name)public IAsyncOperation<StorageFile> GetFileAsync(String name)Public Function GetFileAsync(name As String) As IAsyncOperation( Of StorageFile )
Parameters
name
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.

Attributes

GetFilesAsync() GetFilesAsync() GetFilesAsync()

Gets the files from the current folder.

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

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

Attributes

GetFolderAsync(String) GetFolderAsync(String) GetFolderAsync(String)

Gets the specified folder from the current folder.

public IAsyncOperation<StorageFolder> GetFolderAsync(String name)public IAsyncOperation<StorageFolder> GetFolderAsync(String name)Public Function GetFolderAsync(name As String) As IAsyncOperation( Of StorageFolder )
Parameters
name
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.

Attributes

GetFoldersAsync() GetFoldersAsync() GetFoldersAsync()

Gets the folders in the current folder.

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

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

Attributes

GetItemAsync(String) GetItemAsync(String) GetItemAsync(String)

Gets the specified item from the IStorageFolder.

public IAsyncOperation<IStorageItem> GetItemAsync(String name)public IAsyncOperation<IStorageItem> GetItemAsync(String name)Public Function GetItemAsync(name As String) As IAsyncOperation( Of IStorageItem )
Parameters
name
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 ).

Attributes

GetItemsAsync() GetItemsAsync() GetItemsAsync()

Gets the items from the current folder.

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

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

Attributes