Windows Develop Bookmark and Share   
 index > Windows Forms General > how can I open a file and save it in another location
 

how can I open a file and save it in another location

Pls,

I need to offer the possiblility to the user to open a dialog box to locate a file, so that he can save it in another location on the network

What control and code sample can I use for both those needs

Thank you

R.Tutus  Tuesday, September 12, 2006 3:37 PM
LOL, looks like we had a race condition :D
If you want to let the userto specify the location where the file will be saved, you can use SaveFileDialog to get that location.Once you have the source-path and the destination-path, you can use System.IO.File.Copy.
bb35  Tuesday, September 12, 2006 4:03 PM

What I tried, I used OpenFileDialog to open my source file, then i put it in a string "myFileToSave"

Then I tried to use

SaveFileDialog to save that source file to a new destination, but I don t know in which propertyof mySaveFileDialogI should the fhe file that I want to save or its path

Thanks for your help.

R.Tutus  Tuesday, September 12, 2006 3:51 PM

I think you're looking for System.Windows.Forms.OpenFileDialog. You can find samples and details in MSDN at: http://msdn2.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx

bb35  Tuesday, September 12, 2006 3:54 PM
LOL, looks like we had a race condition :D
If you want to let the userto specify the location where the file will be saved, you can use SaveFileDialog to get that location.Once you have the source-path and the destination-path, you can use System.IO.File.Copy.
bb35  Tuesday, September 12, 2006 4:03 PM

You can use google to search for other answers

Custom Search

More Threads

• full workspace application
• VS.NET 2005 BETA2 vs VS.NET 2005 BETA1
• Is there a built in Most Recently Used (MRU) class?
• how to share memory variable within two forms?
• How to Properly Determine the Default Font for UI Controls?
• using customautocomplete with keydown
• Viewing Large Text Files ( > 120MB) in the rich text box. Is there a better way?
• Issue with backgroundWorker
• Why the TabIndexChanged event of control will not be fired when I switch control tab key?
• Removing a TabPage Containing a DataGridView When Current Cell is Invalid