-2You do not have permission to view the full content of this post.
Log in or register now.
I have created a code that generates a multi lined text file.
What i would like to achieve is read only a specific line and send that value to a specific textbox.
Below is my form :
My Text file sample and What i want to achieve please see below :
Please see below my code :
var open = new OpenFileDialog();
open.Title = "Open File";
open.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*";
if (open.ShowDialog() == DialogResult.OK)
{
FilePathLB.Text = open.InitialDirectory + open.FileName;
StreamReader read = new StreamReader(File.OpenRead(open.FileName));
//X1TB.Text = File.ReadLines(open.FileName).Skip(1).Take(1).First();
//X1TB.Text = read.ReadLine();
X1TB.Text = read.ReadLine();
read.Dispose();
}
Salamat sa mga tutulong.
I have created a code that generates a multi lined text file.
What i would like to achieve is read only a specific line and send that value to a specific textbox.
Below is my form :
My Text file sample and What i want to achieve please see below :
Please see below my code :
var open = new OpenFileDialog();
open.Title = "Open File";
open.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*";
if (open.ShowDialog() == DialogResult.OK)
{
FilePathLB.Text = open.InitialDirectory + open.FileName;
StreamReader read = new StreamReader(File.OpenRead(open.FileName));
//X1TB.Text = File.ReadLines(open.FileName).Skip(1).Take(1).First();
//X1TB.Text = read.ReadLine();
X1TB.Text = read.ReadLine();
read.Dispose();
}
Salamat sa mga tutulong.
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.