Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hub/apps/develop/files/file-access-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ The following table lists additional locations that you can access by declaring
| Pictures | picturesLibrary<br> Also see [Files and folders in the Music, Pictures, and Videos libraries](music-pictures-videos-libraries.md). | [KnownFolders.PicturesLibrary](/uwp/api/windows.storage.knownfolders.pictureslibrary) |
| Videos | videosLibrary<br>Also see [Files and folders in the Music, Pictures, and Videos libraries](music-pictures-videos-libraries.md). | [KnownFolders.VideosLibrary](/uwp/api/windows.storage.knownfolders.videoslibrary) |
| Removable devices | removableStorage <br><br>Note You must add File Type Associations to your app manifest that declare specific file types that your app can access in this location. <br><br>Also see [Access the SD card](/windows/uwp/files/access-the-sd-card). | [KnownFolders.RemovableDevices](/uwp/api/windows.storage.knownfolders.removabledevices) |
| Homegroup libraries | At least one of the following capabilities is needed. <br>- musicLibrary <br>- picturesLibrary <br>- videosLibrary | [KnownFolders.HomeGroup](/uwp/api/windows.storage.knownfolders.homegroup) |
| Homegroup libraries | **Deprecated.** HomeGroup was removed in Windows 10, version 1803. At least one of the following capabilities is needed. <br>- musicLibrary <br>- picturesLibrary <br>- videosLibrary | [KnownFolders.HomeGroup](/uwp/api/windows.storage.knownfolders.homegroup) |
| Media server devices (DLNA) | At least one of the following capabilities is needed. <br>- musicLibrary <br>- picturesLibrary <br>- videosLibrary | [KnownFolders.MediaServerDevices](/uwp/api/windows.storage.knownfolders.mediaserverdevices) |
| Universal Naming Convention (UNC) folders | A combination of the following capabilities is needed. <br><br>The home and work networks capability: <br>- privateNetworkClientServer <br><br>And at least one internet and public networks capability: <br>- internetClient <br>- internetClientServer <br><br>And, if applicable, the domain credentials capability:<br>- enterpriseAuthentication <br><br>**Note:** You must add File Type Associations to your app manifest that declare specific file types that your app can access in this location. | Retrieve a folder using: <br>[StorageFolder.GetFolderFromPathAsync](/uwp/api/windows.storage.storagefolder.getfolderfrompathasync) <br><br>Retrieve a file using: <br>[StorageFile.GetFileFromPathAsync](/uwp/api/windows.storage.storagefile.getfilefrompathasync) |

Expand Down
7 changes: 5 additions & 2 deletions hub/apps/develop/files/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,21 @@ For examples of using the .NET APIs in a WinUI app, see [Access files and folder

If you're developing packaged WinUI apps, the WinRT storage APIs can be a powerful tool for reading and writing data. The following topics provide a wealth of information for developers looking to leverage these APIs in their apps.

> [!NOTE]
> The topics below link to WinRT API documentation which is applicable to both UWP and WinUI 3 (Windows App SDK) apps.

| Topic | Description |
|-------|-------------|
| [Enumerate and query files and folders](/windows/uwp/files/quickstart-listing-files-and-folders) | Access files and folders in either a folder, library, device, or network location. You can also query the files and folders in a location by constructing file and folder queries. |
| [Create, write, and read a file](/windows/uwp/files/quickstart-reading-and-writing-files) | Read and write a file using a [StorageFile](/uwp/api/Windows.Storage.StorageFile) object. |
| [Best practices for writing to files](/windows/uwp/files/best-practices-for-writing-to-files) | Learn best practices for using various file writing methods of the [FileIO](/uwp/api/windows.storage.fileio) and [PathIO](/uwp/api/windows.storage.pathio) classes. |
| [Get file properties](/windows/uwp/files/quickstart-getting-file-properties) | Get properties—top-level, basic, and extended—for a file represented by a [StorageFile](/uwp/api/Windows.Storage.StorageFile) object. |
| [Accessing HomeGroup content](/windows/uwp/files/quickstart-accessing-homegroup-content) | Access content stored in the user's HomeGroup folder, including pictures, music, and videos. |
| [Accessing HomeGroup content](/windows/uwp/files/quickstart-accessing-homegroup-content) | ~~Access content stored in the user's HomeGroup folder.~~ **Note: HomeGroup was removed in Windows 10 version 1803.** |
| [Determining availability of Microsoft OneDrive files](/windows/uwp/files/quickstart-determining-availability-of-microsoft-onedrive-files) | Determine if a Microsoft OneDrive file is available using the [StorageFile.IsAvailable](/uwp/api/windows.storage.storagefile.isavailable) property. |
| [Files and folders in the Music, Pictures, and Videos libraries](/windows/uwp/files/quickstart-managing-folders-in-the-music-pictures-and-videos-libraries) | Add existing folders of music, pictures, or videos to the corresponding libraries. You can also remove folders from libraries, get the list of folders in a library, and discover stored photos, music, and videos. |
| [Track recently used files and folders](/windows/uwp/files/how-to-track-recently-used-files-and-folders) | Track files that your user accesses frequently by adding them to your app's most recently used list (MRU). The platform manages the MRU for you by sorting items based on when they were last accessed, and by removing the oldest item when the list's 25-item limit is reached. All apps have their own MRU. |
| [Track file system changes in the background](/windows/uwp/files/change-tracking-filesystem) | Track changes to the file system, even when the app isn't running.|
| [Access the SD card](/windows/uwp/files/access-the-sd-card) | You can store and access non-essential data on an optional microSD card, especially on low-cost mobile devices that have limited internal storage. |
| [Access the SD card](/windows/uwp/files/access-the-sd-card) | Store and access non-essential data on removable storage media (primarily applicable to devices with SD card slots). |
| [Fast access to file properties](/windows/uwp/files/fast-file-properties) | Efficiently gather a list of files and their properties from a library to use via the Windows Runtime APIs. |

## See also
Expand Down
4 changes: 2 additions & 2 deletions hub/apps/develop/files/list-files-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Access files and folders in either a folder, library, device, or network locatio
For guidance on how to store your WinUI app's data, see the [ApplicationData](/uwp/api/windows.storage.applicationdata) class.

> [!NOTE]
> For a complete sample, see the [Folder enumeration sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/FolderEnumeration).
> For a complete sample, see the [Folder enumeration sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/FolderEnumeration) (UWP sample - uses the same WinRT APIs as WinUI 3 apps).

## Prerequisites

- **Understand async programming for WinUI apps**

You can learn how to write asynchronous apps in C#, see [Call asynchronous APIs in C# or Visual Basic](/windows/uwp/threading-async/call-asynchronous-apis-in-csharp-or-visual-basic). To learn how to write asynchronous apps in C++/WinRT, see [Concurrency and asynchronous operations with C++/WinRT](/windows/uwp/cpp-and-winrt-apis/concurrency).
To learn how to write asynchronous apps in C#, see [Call asynchronous APIs in C# or Visual Basic](/windows/uwp/threading-async/call-asynchronous-apis-in-csharp-or-visual-basic). To learn how to write asynchronous apps in C++/WinRT, see [Concurrency and asynchronous operations with C++/WinRT](/windows/uwp/cpp-and-winrt-apis/concurrency).

- **Access permissions to the location**

Expand Down
4 changes: 2 additions & 2 deletions hub/apps/develop/files/music-pictures-videos-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ Windows.Storage.StorageFolder newFolder = await myPictures.RequestAddFolderAsync

## Remove a folder from a library

To remove a folder from a library, call the [StorageLibrary.RequestRemoveFolderAsync](/uwp/api/windows.storage.storagelibrary.requestremovefolderasync) method and specify the folder to be removed. You could use [StorageLibrary.Folders](/uwp/api/windows.storage.storagelibrary.folders) and a [ListView](/uwp/api/Windows.UI.Xaml.Controls.ListView) control (or similar) for the user to select a folder to remove.
To remove a folder from a library, call the [StorageLibrary.RequestRemoveFolderAsync](/uwp/api/windows.storage.storagelibrary.requestremovefolderasync) method and specify the folder to be removed. You could use [StorageLibrary.Folders](/uwp/api/windows.storage.storagelibrary.folders) and a [ListView](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.listview) control (or similar) for the user to select a folder to remove.

When you call [StorageLibrary.RequestRemoveFolderAsync](/uwp/api/windows.storage.storagelibrary.requestremovefolderasync), the user sees a confirmation dialog saying that the folder "won't appear in Pictures anymore, but won't be deleted." What this means is that the folder remains in its original location on disk, is removed from the [StorageLibrary.Folders](/uwp/api/windows.storage.storagelibrary.folders) property, and will no longer included in the built-in Photos app.

The following example assumes that the user has selected the folder to remove from a [ListView](/uwp/api/Windows.UI.Xaml.Controls.ListView) control named lvPictureFolders.
The following example assumes that the user has selected the folder to remove from a [ListView](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.listview) control named lvPictureFolders.


```csharp
Expand Down
6 changes: 3 additions & 3 deletions hub/apps/develop/files/track-recently-used-files-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ms.localizationpriority: medium
**Important APIs**

- [MostRecentlyUsedList](/uwp/api/windows.storage.accesscache.storageapplicationpermissions.mostrecentlyusedlist)
- [FileOpenPicker](/uwp/schemas/appxpackage/appxmanifestschema/element-fileopenpicker)
- [FileOpenPicker](/uwp/api/windows.storage.pickers.fileopenpicker)

Track files that your user accesses frequently by adding them to your app's most recently used list (MRU). The platform manages the MRU for you by sorting items based on when they were last accessed, and by removing the oldest item when the list's 25-item limit is reached. All apps have their own MRU.

Expand All @@ -25,13 +25,13 @@ Your app's MRU is represented by the [StorageItemMostRecentlyUsedList](/uwp/api/

- **Understand async programming for WinUI apps**

You can learn how to write asynchronous apps in C#, see [Call asynchronous APIs in C# or Visual Basic](/windows/uwp/threading-async/call-asynchronous-apis-in-csharp-or-visual-basic). To learn how to write asynchronous apps in C++, see [Asynchronous programming in C++](/windows/uwp/threading-async/asynchronous-programming-in-cpp-universal-windows-platform-apps).
To learn how to write asynchronous apps in C#, see [Call asynchronous APIs in C# or Visual Basic](/windows/uwp/threading-async/call-asynchronous-apis-in-csharp-or-visual-basic). To learn how to write asynchronous apps in C++, see [Asynchronous programming in C++](/windows/uwp/threading-async/asynchronous-programming-in-cpp-universal-windows-platform-apps).

- **Access permissions to the location**

See [File access permissions](file-access-permissions.md).

- [Open files and folders with a picker](/windows/uwp/files/quickstart-using-file-and-folder-pickers)
- [Open files and folders with a picker](file-pickers.md)

Picked files are often the same files that users return to again and again.

Expand Down