日期:2014-05-17 浏览次数:20934 次
/// <summary> /// 根据路径读一行一行读取出文件类容 /// </summary> /// <param name="path"></param> void GetFileContent(string path) { if (!System.IO.File.Exists(path)) return; System.IO.StreamReader reader = new System.IO.StreamReader(path, Encoding.Default); string content = string.Empty; while (!reader.EndOfStream) { //一行一行的内容 content = reader.ReadLine(); } reader.Close(); reader.Dispose(); }
------解决方案--------------------