美文网首页
C#读文件

C#读文件

作者: 络筱矶 | 来源:发表于2019-09-26 16:30 被阅读0次
            String listLines = " ";  //输出为String类型 
            using (StreamReader reader = new StreamReader(@"path"))
            {
                string line = reader.ReadLine();
                while ((line = reader.ReadLine()) != null)
                {
                    listLines+=line;
                    line = reader.ReadLine();
                }
       
            }

相关文章

网友评论

      本文标题:C#读文件

      本文链接:https://www.haomeiwen.com/subject/zoknuctx.html