C# 读写文件后一定要关闭

//Dispose()方法 StreamReader srd; try { srd = new StreamReader(path, System.Text.Encoding.Default); } catch { Console.WriteLine("File open failed"); return ""; } string r = srd.ReadToEnd(); srd.Dispose(); 

你可能感兴趣的:(String,C#,File,Path)