c# using statement and StreamWriter
问题 I am using a StreamWriter to write things into notepad. And I discover if I am not using statement and instance the StreamWriter alone. The method is unable to run. Does anybody know the reason? static void Main(string[] args) { //StreamWriter c = new StreamWriter(@"C:\Users\rxxx\Desktop\important.txt", true); using (StreamWriter c = new StreamWriter(@"C:\Users\xxx\Desktop\important.txt", true)) { c.WriteLine("hello"); } This can be run. But if I run the remarked part instead. The Notepad