逐行读取.txt

using System;
using System.Collections.Generic;
using System.IO;

namespace ConsoleForPractice
{
class Program
{
static void Main(string[] args)
{
string path = @"E:\\";
StreamReader sr
= new StreamReader(path+@"\0806\RunMachineList.txt");
List
< string> machinelist =new List<string>();

string line;

while ((line = sr.ReadLine()) != null)
{
machinelist.Add(line);

}

foreach (string machine in machinelist)
Console.WriteLine(machine);
Console.ReadLine();
}
}
}

 

posted on 2010-08-11 16:04  I过T  阅读(319)  评论(0编辑  收藏  举报

导航