Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
External Settings File
#1
I need some help with a code, how can I save the text from a RichTextBox to a TXT document? I have tried the following code but when I open the TXT Document there comes a strange code!
Code:
My.Forms.main.txt_text.SaveFile("C:\Program Files\info\Text.txt", RichTextBoxStreamType.RichText)


And then I have a second question:
How can I make a code so that for example the setting 'Text' contains the text from the saved TXT Document above?
#2
How to save a file
Code:
Dim writer as new system.io.streamwriter("PATH")
writer.write("TEXT")
writer.close()
How to read a file
Code:
Dim text as string
dim reader as new system.io.streamreader("PATH")
text = reader.readToEnd()
reader.close()
My Blog | My Setup | My Videos | Have a wonderful day.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Rename application file brco900033 3 14,838 10-15-2013, 12:03 AM
Last Post: brandonio21
  Copy file to clipboard brco900033 4 17,367 11-04-2012, 12:17 AM
Last Post: brandonio21
  getting a file name form a save dialoge zmanalpha 3 14,113 08-04-2012, 03:15 PM
Last Post: brandonio21

Forum Jump:


Users browsing this thread: 1 Guest(s)