更新时间:2023-02-20 10:51:49
这是从 wp7 应用程序中的解决方案读取文本文件的解决方案.
Here is the solution to read a text file from solution in wp7 app.
复制解决方案中的文本文件.
Copy text file in your solution.
右键单击 -> 属性
现在将构建操作设置为资源.
Now set Build Action to Resource.
System.IO.Stream src = Application.GetResourceStream(new Uri("solutionname;component/text file name", UriKind.Relative)).Stream;
using (StreamReader sr = new StreamReader(src))
{
string text = sr.ReadToEnd();
}