After I got a file ( example: a.txt) from assests folder, while I'm reading this file line by line
this code part ( line=reader.Readline()
) have to read content of a file's line; but line
is getting a file path.
I want to add all line in the file to list.(lines
)
****** This project is about Universal App and **Windows Phone 8.1 part
List<string> lines = new List<string>();
public async void LoadFile(string file)
{
var InstallationFolder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync("Assets");
var _file = await InstallationFolder.GetFileAsync(file);
byte[] byteArray = Encoding.UTF8.GetBytes(file);
MemoryStream stream = new MemoryStream(byteArray);
using (var reader = new StreamReader(stream))
{
string line = null;
while ((line = reader.ReadLine()) != null)
{
lines.Add(line);
}
}
}