-1

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.

svick
  • 236,525
  • 50
  • 385
  • 514

1 Answers1

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