【发布时间】:2013-06-14 00:32:33
【问题描述】:
我正在开发 Windows 商店应用程序。我有这个文本文件名为:text.txt
account1 string1
account2 string2
account3 string3
还有这个 c# 代码:
private async void Page_Loaded(object sender, RoutedEventArgs e)
{
var path = "text.txt";
var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
try
{
var file = await folder.GetFileAsync(path);
}
catch (FileNotFoundException)
{
test.Text = "error";
}
}
代码可以毫无问题地找到文本文件。但我无法阅读它。我想从文本文件中读取帐户名称(account1,account2,account3),并将其添加到名为“x”的数组列表中 并将 strings(string1, string2, string3) 添加到名为“y”的数组列表中。
感谢您的帮助。问候...
【问题讨论】:
标签: c# windows-8 windows-store-apps