Родитель
15c41c140e
Коммит
d01e058222
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче