how to use openFileDialog
-
Hi all, how to open a text file
Don't wait to hear a word of thanks from anybody when you help them instead ask them to help three other people and ask them to continue in chain.
-
Hi all, how to open a text file
Don't wait to hear a word of thanks from anybody when you help them instead ask them to help three other people and ask them to continue in chain.
Google is broken where you live ? here
-
Google is broken where you live ? here
hi, I know how to browse a file and read the data from the file into a richtextbox in windowsform but my problem is I am not able print each file as it is but I am able to print just as appending to each line using the following code: code : OpenFileDialog dlg = new OpenFileDialog(); dlg.Title = "Open text file"; dlg.InitialDirectory = @"c:\"; dlg.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; if (dlg.ShowDialog() == DialogResult.OK) { StreamReader sr = File.OpenText(dlg.FileName); string s = sr.ReadLine(); StringBuilder sb = new StringBuilder(); while (s != null) { sb.Append(s); s = sr.ReadLine(); } sr.Close(); this.richTextBox1.Text = sb.ToString(); } can you please help me to read file as it is with newline characters to richtexbox
Don't wait to hear a word of thanks from anybody when you help them instead ask them to help three other people and ask them to continue in chain.
-
hi, I know how to browse a file and read the data from the file into a richtextbox in windowsform but my problem is I am not able print each file as it is but I am able to print just as appending to each line using the following code: code : OpenFileDialog dlg = new OpenFileDialog(); dlg.Title = "Open text file"; dlg.InitialDirectory = @"c:\"; dlg.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; if (dlg.ShowDialog() == DialogResult.OK) { StreamReader sr = File.OpenText(dlg.FileName); string s = sr.ReadLine(); StringBuilder sb = new StringBuilder(); while (s != null) { sb.Append(s); s = sr.ReadLine(); } sr.Close(); this.richTextBox1.Text = sb.ToString(); } can you please help me to read file as it is with newline characters to richtexbox
Don't wait to hear a word of thanks from anybody when you help them instead ask them to help three other people and ask them to continue in chain.
veluru krishna wrote:
while (s != null) { sb.Append(s); sb.Append(Environment.NewLine); s = sr.ReadLine(); }