请问:
现知道文件的路径和名称, 如何用c#调用系统本身程序打开这个文件(图片或者word/excel文件)?
谢谢!

解决方案 »

  1.   

    System.Diagnostics.Process.Start("C:\a.doc");
      

  2.   

    System.Diagnostics.Process.Start("d:\a.doc");
    就这样,系统会判断文件后缀名自动调用程序打开。
    这样就够了,当然你也可以加上路径和参数的形式来调用,效果一样的
      

  3.   

    [DllImport("shell32.dll", EntryPoint="ShellExecute")]
    两种方法:
    1、System.Diagnostics.Process.Start(strFilePath);
    2、using System.Runtime.InteropServices;
    public static extern bool ShellExecute (
    IntPtr hwnd,
    string lpOperation,
    string lpFile,
    string lpParameters,
    string lpDirectory,
    int nShowCmd
    );调用外部函数也可以.不过这个要引用命名空间.
      

  4.   

    using System.Diagnostics;
    Process.Start("IExplore.exe", "C:\\myPath\\myFile.htm");
    Process.Start("IExplore.exe", "C:\\myPath\\myFile.asp");
      

  5.   

    直接用
    System.Diagnostics.Process.Start(你的文件名的全路径);就可以了,系统会自动用对应的软件打开的
    如果是网页就用IE打开,如果是*.doc就用WORD打开