📜  c# xamarin 表单使用 AssetManager 获取文本文件 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:22.882000             🧑  作者: Mango

代码示例1
// c# Xamarin Forms for Andriod
strin text = string.Empty;
string filename = "TestList.txt";

AssetManager assets = Android.App.Application.Context.Assets;
using (StreamReader reader = new StreamReader(assets.Open(filename)))
{
    text = reader.ReadToEnd();
}