Answer the question
In order to leave comments, you need to log in
Reading from openfiledialog file and outputting to 2 textboxes?
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
string file = openFileDialog1.FileName;
try
{
string text = File.ReadAllText(file);
textBox1.Text = (text);
}
catch (IOException exception)
{
MessageBox.Show(exception.Message);
}
}
Answer the question
In order to leave comments, you need to log in
Well, what's the problem? The task is simple to the primitive.
string s1,s2;
foreach(var item in File.ReadAllLines())
{
var t = item.Split(':')
s1+= t[0]
s2+= t[1]
}
textBox1.Text = s1;
textBox2.Text = s2;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question