Hy guys,
My task is to take some string from GUI (which is supposed to be a path to the file) and to read a file from the filestream.
pretty simle, but I failed with the mission.
the code snippet is like this:
public class BI
{
string _path;
FileStream stream = new FileStream(_path, FileMode.Open, FileAccess.Read);
StreamReader reader = new StreamReader(stream);
public LottoMashine(string path)
{
_path = Path.Combine(path);
}
}
What do I get?
Error2 A field initializer cannot reference the non-static field, method, or property
What did I do the wrong pay?