public partial class Form1 : Form
{
}
static class Questions
{
public static var contents = File.ReadAllLines(@"TextFile/Questions.txt");
public static var newRandom = new Random();
public static var randomLine = newRandom.Next(0, contents.Length - 1);
public static var questionToAsk = contents[randomLine];
}
But it dives me the following error:
the contexual keyword 'var' ....
The variable questionToAsk has a random line from a textfile and it gets set. But when I try to access it from the SomeOther method. I can not call it.
What is a way around this?
Thanks guys.