i am newbie to c# and started few months before, i am facing problem in copying two files and saving it in the other location which the user defines. have you seen notepad in microsoft windows? when clicked exit is asked for save. and when clicked yes then it give the dialog for saving where you want like that i want. i have two files in c\program files\myfolder and i want to move it to the user define location. how that can be done? i have to design that dialog form also? that buttons that save cancle button and combobox also? and all things which comes in that dialog or some easy thing is provided by c#?
Asked
Active
Viewed 310 times
1 Answers
0
There is a built-in .NET dialog for this, look up OpenFileDialog
Ignore the fact that it has 'open' in the name, it can equally be used to select a location to save files to.
http://msdn.microsoft.com/en-gb/library/system.windows.forms.openfiledialog.aspx

paul
- 21,653
- 1
- 53
- 54
-
thank you sir you have simplified my work and sir how to set the file i want to copy? i want that when opened directly i want option where the user want to save – aquib Rocks Jan 31 '13 at 14:35
-
You could store the last used folder in the application settings, and set the `InitialDirectory` property before opening the dialog. This would set the initial folder presented to the user. – paul Jan 31 '13 at 14:43
-
sir i have two files i want to set that as a copy. when user presses a button i want that a dialog opeing and just at the start it tells where the user want to copy that file to the user defines drive. i dont want user to search the location where my files are there. can you help me some more – aquib Rocks Jan 31 '13 at 14:44
-
sir can you help me out here http://stackoverflow.com/questions/14632641/selecting-files-and-saving-it-to-the-defined-location-using-folder-browse-dialog – aquib Rocks Jan 31 '13 at 18:43