------ <a target="blank">Windows Phone 7手机...
这种方法可行吗?using System;using System.IO;
using System.Collections;namespace TextFileReader_csharp
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
static void Main(string[] args)
{
StreamReader objReader = new StreamReader("c:\\test.txt");
string sLine="";
ArrayList arrText = new ArrayList(); while (sLine != null)
{
sLine = objReader.ReadLine();
if (sLine != null)
arrText.Add(sLine);
}
objReader.Close(); foreach (string sOutput in arrText)
Console.WriteLine(sOutput);
Console.ReadLine();
}
}
}
|