Is there any way to show string array items in textbox seperated with comma. I am unable to get it right, running through lots of trials and errors.
Any help or suggestion with be highly appreciated.
private void button9_Click(object sender, EventArgs e)
{
int lineNum = 1;
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "Text Files|*.txt";
openFileDialog1.Title = "Select a Text file";
openFileDialog1.FileName = "";
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
string file = openFileDialog1.FileName;
string[] text = System.IO.File.ReadAllLines(file);
foreach (string line in text)
{
if (lineNum <= 30)
{
textBox1.Text = Convert.ToString( text);
}
else
{
textBox2.Text = Convert.ToString(text);
}
}
}
}
Any suggestion please