Click here to Skip to main content
15,919,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello dears.
I used saveFileDialog to save a text of richtextbox, code of save button:
C#
saveFileDialog1.ShowDialog();
richTextBox1.SaveFile(saveFileDialog1.FileName);

And this is my problem:
1.in opening window to set path and name, there is not default name for saving file
2.when i open the saved file there are a lot of characters more than richbox.text

please help me.im new on c# and i need more explain.
Posted
Updated 31-Jul-12 23:26pm
v5
Comments
bbirajdar 1-Aug-12 5:03am    
Why are you so desperate ?

You have saved the file as default type (RTF) so it will include all the control characters. If you want plain text then use the form of SaveFile()[^] that allows you to specifiy the type of the output stream.

NB: Adding lots of e's to the word please will not got your question answered any faster; it just makes you look like a jerk.
 
Share this answer
 
Comments
siasalar 1-Aug-12 5:14am    
:( i'm not jerk
anyway Thank You
Your answer is here:

SaveFileDialog[^]

*OpenFileDialogx[^]
 
Share this answer
 
v2
see here for more details:

http://msdn.microsoft.com/en-us/library/aa984409(v=vs.71).aspx[^]

1)generally we will use savefile dialog box because of what ever we will write in textbox that will stores on where ever you want(required path).
2)now u can create a notepad to u r learning purpose . see here example
http://forum.codecall.net/topic/45330-a-simple-notepad-in-c/[^]
 
Share this answer
 
Comments
siasalar 1-Aug-12 6:24am    
Thank You

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900