Page of the application with the TextBlock and Button, also involved .txt document with the text (Proposals, each proposal on the same line, only about 100 lines). When you click on a Button sentence (the first textline of the document) is displayed in the TextBlock:
public string GetQ()
{
string pathFile = "Q.txt";
Uri uri = new Uri(pathFile, UriKind.Relative);
StreamResourceInfo sri = Application.GetResourceStream(uri);
using (StreamReader sr = new StreamReader(sri.Stream))
{
string wordline = sr.ReadLine();
return wordline;
}
}
How do I make the next time you press the Button, appeared the next line of the document?
Thanks!
This is untested, but you could just store the file in a string array and then access what you need out of there without reopening the file constantly to read each line.
Now you can just load
qFile[0]toqFile[qFile.Count - 1].