我嘗試讀取下一個內容txt文件:我如何正確讀取windows phone中的txt文件?
我用這個方法來讀取TXT文件:
public string ReadFileContents()
{
//this verse is loaded for the first time so fill it from the text file
var ResrouceStream = Application.GetResourceStream(new Uri("Files/info.txt", UriKind.Relative));
if (ResrouceStream != null)
{
Stream myFileStream = ResrouceStream.Stream;
if (myFileStream.CanRead)
{
StreamReader myStreamReader = new StreamReader(myFileStream);
//read the content here
return myStreamReader.ReadToEnd();
}
}
return string.Empty;
}
該方法返回到我下一個字符串錯誤的符號:
我怎麼能正確讀取txt文件?
如果您將實體用於'®',它會起作用嗎? – 2012-02-02 09:03:05