Save a file???  
Author Message
Evan Mulawski





PostPosted: Windows Forms General, Save a file??? Top

I am creating a web browser (eariler versions on www.freewebs.com/evanmulawski) and am wondering how to create a 'save target as...' context menu strip item, so that I can save the file that the mouse is currently on.

Thanks, Evan Mulawski




Windows Forms6  
 
 
Christopher Fleming





PostPosted: Windows Forms General, Save a file??? Top

Hello Evan,

You really just need to add a new contextMenuStrip to your form with whatever menu options you want to offer and then set the form's ContextMenuStrip property to this. You would then want to enable and disable each ToolStripMenuItem as needed programmatically. Here is a little more detailed usage information.



 
 
wizkid1





PostPosted: Windows Forms General, Save a file??? Top

I know how to use the context menu strip, but I need to know how to save the file on the website you want. Like downloading an MP3, right-click brings up the cms, save target as... brings up the save file dialog, but I need to know how to set the save file dialog to the file that you are downloading.



 
 
John230873





PostPosted: Windows Forms General, Save a file??? Top

If I am reading you correctly I think what you need to do is a 2 step process and you are only doing 1 step at the moment.

In the save dialog allow the user to select where they want to save the file to, as soon as they select where to save the file to then you need to copy the location of the current file to the new location using fileIO.

So I guess in General you get the location of the source (web page) and the target from the savedialog then use a simple fileIO copy file.

Does this help