Never write this code again in C#:
FileStream fs = new FileStream(logName, FileMode.Create);
fs.Write(logBytes, 0, logBytes.Length);
fs.Flush();
fs.Close();
Do this instead:
File.WriteAllBytes(logName, logBytes);
2008-01-09
No More File Crap, Please?
Labels:
advice,
code,
programming,
software
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment