private void button1_Click(object sender, RoutedEventArgs e)
{
StreamReader sr = new StreamReader(@"C:\Documents and Settings\Administrator\桌面\aa.txt");
int k = 1;
int rowNo = int.Parse(label1.Content.ToString());
while (!sr.EndOfStream)
{
string str = sr.ReadLine();
if (k == rowNo)
{
textBox1.Text = str;
break;
}
k++;
}
sr.Close();
sr.Dispose();
}
-------------------------------------------------------------