0
var sdcardpath = Android.OS.Environment.ExternalStorageDirectory.Path;
var filepath = System.IO.Path.Combine(sdcardpath, "first.html");
System.IO.StreamWriter writer = new StreamWriter(filepath, true);
if (!System.IO.File.Exists(filepath))
{
writer.Write(htmltext);
}
else
{
var txt = System.IO.File.ReadAllText(filepath);
}
這樣,我想從我的本地存儲讀取HTML,但同時readalltext我得到異常 System.IO.IOException:在路徑共享衝突/storage/emulated/0/first.html如何從本地存儲中讀取xamarin android?
你爲什麼要創建一個作家,然後讀取文件中的
StreamWriter
創造?爲什麼不把作者放在if區塊? – Jason謝謝你傑森你的信息 – Nawin