Process.Start("应用程序", "参数");
或者:
Process.Start("cmd.exe", "c:\a.doc");
我试过,doc和ppt等office文件都好用

解决方案 »

  1.   

    System.Diagnostics.Process.Start("文件名");
      

  2.   

    windows会自动查注册表打开,或者你也可以查注册表看看相关文件用什么程序打开。
      

  3.   

    to fyy117
    System.Diagnostics.Process.Start("文件名");
    好像不行呀!
    出错如下:
    D:\mk\多表关联的数据操作\WindowsApplication1\Form1.cs(250): 无法使用实例引用访问静态成员“System.Diagnostics.Process.Start(string)”;改用类型名来限定它
      

  4.   

    string 是保留字,你不能将它做变量名,改用其它的
      

  5.   

    你可以使用Process.Start 直接启动它,不管是什么文件都会自动检测关联,如果不存在关联会自动提示打开方式,它其实就是ShellExecute 的封装你也可以使用:[DllImport("shell32.dll", EntryPoint="ShellExecute")]
    public static extern int ShellExecute (int hwnd,string lpOperation,string lpFile,string lpParameters,string lpDirectory,int nShowCmd);比如:ShellExecute(this.Handle.ToInt32(),"open","c:\1.doc",null,Application.StartupPath,1);