views:

180

answers:

1

Hi,

When a user clicks on a button on the winforms application, I will generate a CSV file.

I then want to ask the user to either save the file to disk OR open the file.

How can I do that?

Note: I am just generating the file in memory, not writing it to disk until the user selects the path to save it to.

+1  A: 

If you are looking to open this for the user in the default application for CSV on their machine, you will need to write it to disk to make it happen.

What I would do is if they want to save it, just save it to their location!

If they want to open it, save it to the temp directory, then use System.Diagnostics.Process.Start(path) to open it in the default application.

Mitchel Sellers