应用程序中读取工程目录下的txt文本文件方法,将TXT添加到资源,设置属性为content,读取方法为:
string fileName = "123.txt";
StreamResourceInfo resourceInfo = Application.GetResourceStream(new Uri(fileName, UriKind.Relative));using (StreamReader reader = new StreamReader(resourceInfo.Stream))
{
writingTextBlock.Text = reader.ReadToEnd();
reader.Close();
}
}
}

本文介绍了在应用程序中如何从工程目录下读取并处理TXT文本文件,包括将TXT添加到资源、设置属性及读取文本内容的方法。
4235

被折叠的 条评论
为什么被折叠?



