IStorageFolder 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 IStorageFolder : IStorageItem
public interface IStorageFolder : IStorageItem
Public Interface IStorageFolder Implements IStorageItem
// You can't instantiate an interface directly in JavaScript. You can use objects that implement the interface, however.
Inheritance
IStorageFolderIStorageFolderIStorageFolderIStorageFolder
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
musicLibrary picturesLibrary videosLibrary documentsLibrary

Methods

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

Creates a new file in the current folder.

public : IAsyncOperation<StorageFile> CreateFileAsync(Platform::String desiredName)
public IAsyncOperation<StorageFile> CreateFileAsync(String desiredName)
Public Function CreateFileAsync(desiredName As String) As IAsyncOperation( Of StorageFile )
var iAsyncOperation = iStorageFolder.createFileAsync(desiredName);
Parameters
desiredName
Platform::String String String String

The desired name of the file to create.

Returns
See Also

CreateFileAsync(String, CreationCollisionOption) 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(Platform::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 )
var iAsyncOperation = iStorageFolder.createFileAsync(desiredName, options);
Parameters
desiredName
Platform::String String String 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 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
See Also

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

Creates a new folder in the current folder.

public : IAsyncOperation<StorageFolder> CreateFolderAsync(Platform::String desiredName)
public IAsyncOperation<StorageFolder> CreateFolderAsync(String desiredName)
Public Function CreateFolderAsync(desiredName As String) As IAsyncOperation( Of StorageFolder )
var iAsyncOperation = iStorageFolder.createFolderAsync(desiredName);
Parameters
desiredName
Platform::String String String String

The desired name of the folder to create.

Returns
See Also

CreateFolderAsync(String, CreationCollisionOption) 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(Platform::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 )
var iAsyncOperation = iStorageFolder.createFolderAsync(desiredName, options);
Parameters
desiredName
Platform::String String String 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 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
See Also

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

Gets the specified file from the current folder.

public : IAsyncOperation<StorageFile> GetFileAsync(Platform::String name)
public IAsyncOperation<StorageFile> GetFileAsync(String name)
Public Function GetFileAsync(name As String) As IAsyncOperation( Of StorageFile )
var iAsyncOperation = iStorageFolder.getFileAsync(name);
Parameters
name
Platform::String String String 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<IVectorView<StorageFile>> GetFilesAsync()
public IAsyncOperation<IReadOnlyList<StorageFile>> GetFilesAsync()
Public Function GetFilesAsync() As IAsyncOperation<IReadOnlyList<StorageFile>>( Of IVectorView )
var iAsyncOperation = iStorageFolder.getFilesAsync();
Returns
IAsyncOperation<IVectorView<StorageFile>> IAsyncOperation<IReadOnlyList<StorageFile>> IAsyncOperation<IReadOnlyList<StorageFile>> IAsyncOperation<IReadOnlyList<StorageFile>>

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.

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

Gets the specified folder from the current folder.

public : IAsyncOperation<StorageFolder> GetFolderAsync(Platform::String name)
public IAsyncOperation<StorageFolder> GetFolderAsync(String name)
Public Function GetFolderAsync(name As String) As IAsyncOperation( Of StorageFolder )
var iAsyncOperation = iStorageFolder.getFolderAsync(name);
Parameters
name
Platform::String String String 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<IVectorView<StorageFolder>> GetFoldersAsync()
public IAsyncOperation<IReadOnlyList<StorageFolder>> GetFoldersAsync()
Public Function GetFoldersAsync() As IAsyncOperation<IReadOnlyList<StorageFolder>>( Of IVectorView )
var iAsyncOperation = iStorageFolder.getFoldersAsync();
Returns
IAsyncOperation<IVectorView<StorageFolder>> IAsyncOperation<IReadOnlyList<StorageFolder>> IAsyncOperation<IReadOnlyList<StorageFolder>> IAsyncOperation<IReadOnlyList<StorageFolder>>

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

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

Gets the specified item from the IStorageFolder.

public : IAsyncOperation<IStorageItem> GetItemAsync(Platform::String name)
public IAsyncOperation<IStorageItem> GetItemAsync(String name)
Public Function GetItemAsync(name As String) As IAsyncOperation( Of IStorageItem )
var iAsyncOperation = iStorageFolder.getItemAsync(name);
Parameters
name
Platform::String String String 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<IVectorView<IStorageItem>> GetItemsAsync()
public IAsyncOperation<IReadOnlyList<IStorageItem>> GetItemsAsync()
Public Function GetItemsAsync() As IAsyncOperation<IReadOnlyList<IStorageItem>>( Of IVectorView )
var iAsyncOperation = iStorageFolder.getItemsAsync();
Returns
IAsyncOperation<IVectorView<IStorageItem>> IAsyncOperation<IReadOnlyList<IStorageItem>> IAsyncOperation<IReadOnlyList<IStorageItem>> IAsyncOperation<IReadOnlyList<IStorageItem>>

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.

DeleteAsync DeleteAsync DeleteAsync DeleteAsync

Inherited from IStorageItem

DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption)

Inherited from IStorageItem

GetBasicPropertiesAsync GetBasicPropertiesAsync GetBasicPropertiesAsync GetBasicPropertiesAsync

Inherited from IStorageItem

IsOfType(StorageItemTypes) IsOfType(StorageItemTypes) IsOfType(StorageItemTypes) IsOfType(StorageItemTypes)

Inherited from IStorageItem

RenameAsync(String) RenameAsync(String) RenameAsync(String) RenameAsync(String)

Inherited from IStorageItem

RenameAsync(String,NameCollisionOption) RenameAsync(String,NameCollisionOption) RenameAsync(String,NameCollisionOption) RenameAsync(String,NameCollisionOption)

Inherited from IStorageItem

Properties

Attributes Attributes Attributes Attributes

Inherited from IStorageItem

DateCreated DateCreated DateCreated DateCreated

Inherited from IStorageItem

Name Name Name Name

Inherited from IStorageItem

Path Path Path Path

Inherited from IStorageItem

See Also