* Add concrete example.

* Edit.
This commit is contained in:
David Britch 2024-08-30 10:07:47 +01:00 коммит произвёл GitHub
Родитель 15c41c140e
Коммит d01e058222
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -1,7 +1,7 @@
---
title: "File system helpers"
description: "Learn how to use the .NET MAUI IFileSystem interface in the Microsoft.Maui.Storage namespace. This interface contains helper methods that access the application's cache and data directories, and helps open files in the app package."
ms.date: 06/25/2024
ms.date: 08/30/2024
no-loc: ["Microsoft.Maui", "Microsoft.Maui.Storage", "FileSystem"]
---
@ -35,6 +35,12 @@ To open a file that is bundled into the app package, use the `OpenAppPackageFile
:::code language="csharp" source="../snippets/shared_1/Storage.cs" id="filesys_readtxtfile":::
The following example demonstrates opening a bundled font file from the app package:
```csharp
await using var myFont = await FileSystem.OpenAppPackageFileAsync("MyFont.ttf");
```
### Copy a bundled file to the app data folder
You can't modify an app's bundled file. But you can copy a bundled file to the [cache directory](#cache-directory) or [app data directory](#app-data-directory). The following example uses `OpenAppPackageFileAsync` to copy a bundled file to the app data folder: