How would you make a Save button that, unlike a SaveAs button, will save over the previously selected file without opening a dialog? I have no trouble utilizing SaveAs to open a Save Dialog and create a file but automatically saving to a previously set text file has stumped me.
Asked
Active
Viewed 51 times
-1
-
1Is it the writing or knowing _where_ to write that is the problem? Or something else entirely? – HABO May 06 '14 at 02:37
-
writing it is my problem. – user3594691 May 06 '14 at 02:57
1 Answers
0
did you try something like that :
System.IO.File.AppendAllText(previously file path, the new value);

thealghabban
- 448
- 2
- 4
-
I figured it out for the most part. My program uses a SaveAs button as well as the Save button so I created a global variable to hold the last used filename from my SaveAs click event. I then use that that variable when creating a new filestream for my Save button at it works. I was gonna show the details of how I did it but apparently I don't have enough rep to answer my own questions yet. Thanks for the help everyone. – user3594691 May 06 '14 at 03:29