I'm trying what the program read a determinate line of a text file but don't run. Someone can help me?.
Thx.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Prueba___IO
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
StreamReader sr = new StreamReader("C:\\texto.txt");
string texto;
int linea = textBox1.Text;
for (int i = 1; i >= linea; i++)
{
texto = sr.ReadLine();
}
label1.Text = texto;
}
}
}