|
-
Oct 30th, 2007, 05:37 PM
#1
Thread Starter
Junior Member
[2005]RTB Save Plain Text
So, here's my predicment I've tried for a while. No dice. I'm trying to save a file in a RTB, now I've always used:
Save Code Code:
My.Computer.FileSystem.WriteAllText("C:\Test.txt", "Text", True)
The sample inside the snippets section. It always worked for normal textboxes, but I moved onto now use a RTB to highlight syntax and now I'm having problems, the files now saving line breaks as weird symbols. Any ideas?
-
Oct 30th, 2007, 07:51 PM
#2
Re: [2005]RTB Save Plain Text
The RichTextBox control has its own methods to save its contents. By default it will save RTF but you can specify plain text if you want. That said, if you save plain text then you'll lose all your markup. If that's not what you want then save as RTF.
-
Oct 31st, 2007, 04:02 PM
#3
Thread Starter
Junior Member
Re: [2005]RTB Save Plain Text
Err I should have been more specfic, using SaveFile,PlainText or whatever it is, it still leavs these annyoing little squares wherever a line break should be!
When opened in Notepad that is,
-
Nov 1st, 2007, 09:11 AM
#4
Re: [2005]RTB Save Plain Text
What jmc was suggesting in code form:
Code:
RichTextBox1.SaveFile(IO.File.CreateText("C:\test.txt").BaseStream, RichTextBoxStreamType.PlainText)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|