0
Take a look at some of the documentation online for this class ( it is really necessary to go through these details to understand how it works).
Try below code (After you go through the details).
I have rich textbox with some content in it and a button (Save), on button click event, I am showing the dialog and if user opts to save it, it saves the content to appropriate file.
- private void button1_Click(object sender, EventArgs e)
- {
- if (saveFile.ShowDialog()== DialogResult.OK)
- {
- File.WriteAllText(saveFile.FileName, richTextBox1.Text);
- }
-
- }
Accepted 0
see this article, it explains all what you want. You can specify the file path to any directory instead of bin folder.
http://www.c-sharpcorner.com/uploadfile/38268a/create-word-document-from-win-form-with-users-data/ |
0
No, can please elobrate this.
0
Did you try using SaveFileDialog ?