How can I show the “Open with” file dialog?

后端 未结 4 1142
不知归路
不知归路 2020-11-29 08:33

Is there any simple way to open the \"Open with\" file dialog?

4条回答
  •  一整个雨季
    2020-11-29 09:13

    Using

    System.Diagnostics.Process.Start(path);
    

    The file will be openened with the default program, if no default program is defined the open with dialog will be shown.

    You can use the the function:

    [DllImport("shell32.dll", SetLastError = true)]
    extern public static bool 
           ShellExecuteEx(ref ShellExecuteInfo lpExecInfo);
    

    You have an example to use this function on: this link

提交回复
热议问题