Open file base on type

A

AY Xu

I have a data grid view, list the files saved in SQL server. File type
may different in different rows. I want to achieve:
doule click one row in data grid view, a standard program be called to
open the selected file. Say MS word to open a .doc file, MS power
point to open .ppt file, etc.

In asp.net, I use Response.OutputStream.Write to achieve this, it's
pretty easy. is that a similar way in Windows application? Thanks in
advance!
 
K

kimiraikkonen

I have a data grid view, list the files saved in SQL server. File type
may different in different rows. I want to achieve:
doule click one row in data grid view, a standard program be called to
open the selected file. Say MS word to open a .doc file, MS power
point to open .ppt file, etc.

In asp.net, I use Response.OutputStream.Write to achieve this, it's
pretty easy. is that a similar way in Windows application? Thanks in
advance!

If i understood correclty,

System.Diagnostics.Process.Start
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx

Sure, if necessary applications have been associated with proper file
types like Ms Word for *.doc extensions already.

Hope this helps,

Onur Güzel
 
A

AY Xu

If i understood correclty,

System.Diagnostics.Process.Starthttp://msdn.microsoft.com/en-us/library/system.diagnostics.process.st...

Sure, if necessary applications have been associated with proper file
types like Ms Word for *.doc extensions already.

Hope this helps,

Onur G¨¹zel

Great, you point me to the right direction! i just set the file name,
then process.start(), .net automatically start right program to open
the file. that's great! thanks for help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top