Open file base on type

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AY Xu

    Open file base on type

    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.Output Stream.Write to achieve this, it's
    pretty easy. is that a similar way in Windows application? Thanks in
    advance!
  • kimiraikkonen

    #2
    Re: Open file base on type

    On Aug 3, 11:46 am, AY Xu <ay...@yahoo.co mwrote:
    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.Output Stream.Write to achieve this, it's
    pretty easy. is that a similar way in Windows application? Thanks in
    advance!
    If i understood correclty,

    System.Diagnost ics.Process.Sta rt


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

    Hope this helps,

    Onur Güzel

    Comment

    • AY Xu

      #3
      Re: Open file base on type

      On 8ÔÂ3ÈÕ, ÏÂÎç5ʱ19·Ö, kimiraikkonen <kimiraikkone.. ..@gmail.comwro te:
      On Aug 3, 11:46 am, AY Xu <ay...@yahoo.co mwrote:
      >
      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.Output Stream.Write to achieve this, it's
      pretty easy. is that a similar way in Windows application? Thanks in
      advance!
      >
      If i understood correclty,
      >
      System.Diagnost ics.Process.Sta rthttp://msdn.microsoft. com/en-us/library/system.diagnost ics.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!

      Comment

      Working...