T
Tony Johansson
Hi!
I have this simple program where I use two classes to hande files.
Is this the correct order to close files that is opened ?
static void Main()
{
string s= "tonytest";
long l = 123;
FileStream fs = new FileStream("test.bin",FileMode.Create);
BinaryWriter binw = new BinaryWriter(fs);
binw.Write(s);
binw.Write(l);
binw.Close();
fs.Close();
}
//Tony
I have this simple program where I use two classes to hande files.
Is this the correct order to close files that is opened ?
static void Main()
{
string s= "tonytest";
long l = 123;
FileStream fs = new FileStream("test.bin",FileMode.Create);
BinaryWriter binw = new BinaryWriter(fs);
binw.Write(s);
binw.Write(l);
binw.Close();
fs.Close();
}
//Tony