- Code: Select all
private void Form1_Shown(object sender, EventArgs e)
{
FileStream istream;
try
{
istream = new FileStream("config.txt", FileMode.OpenOrCreate, FileAccess.Read);
}
catch (Exception)
{
}
// Associate a reader with the stream
StreamReader reader = new StreamReader(istream);
string text = reader.ReadLine();
reader.Close();
}
Error is in spanish but it's something like: "Use of the local variable not assigned 'istream' " on this line: StreamReader reader = new StreamReader(istream);






