读取文本行

    public static string gettextbyline(int line)
{

StreamReader sr
= new StreamReader("connectionString.do", Encoding.GetEncoding("GB2312"));
String strline;
TextBox textBox1
= new TextBox();
while ((strline = sr.ReadLine()) != null)
{
textBox1.Text
+= strline.ToString() + "\r\n";

}
return textBox1.Lines[line - 1].ToString();
}

posted @ 2011-08-06 14:22  qanholas  阅读(259)  评论(0编辑  收藏  举报