open a nodepad.txt in c# program
-
hi, i keep a logging in a .txt file, i would like to open this file by pressing a button in my program. how do i do this? is this even possible?? thx grz
-
hi, i keep a logging in a .txt file, i would like to open this file by pressing a button in my program. how do i do this? is this even possible?? thx grz
-
-
then you should open the text from within your program and display in a Read-only (or disabled) text control. You cannot open en text in notepad and somehow disable it from editing. StreamReader srMyLogfile = new StreamReader("path/to/file.txt"); txtYourTextbox.Text = sr.ReadToEnd(); txtYourTextbox.Enabled = false; srMyLogfile.Close(); srMyLogfile.Dispose();
- - - --[ i love it when a plan comes together ]-- - - -
-
hi, i keep a logging in a .txt file, i would like to open this file by pressing a button in my program. how do i do this? is this even possible?? thx grz
I have written a blog post that show's you to read and write a text file hope this helps you. http://threenineconsulting.com/forum/blogs/cykophysh/archive/2006/11/24/Write-and-Read-a-Text-File-In-C_2300_.aspx
Kind Regards, Gary