C# winform 启动外部程序
程序员文章站
2022-06-28 23:19:16
//class里面放入这段代码[DllImport("shell32.dll")]public static extern int ShellExecute(IntPtr hwnd, StringBuilder lpszOp, StringBuilder lpszFile, StringBuilde ......
//class里面放入这段代码
[dllimport("shell32.dll")]
public static extern int shellexecute(intptr hwnd, stringbuilder lpszop, stringbuilder lpszfile, stringbuilder lpszparams, stringbuilder lpszdir, int fsshowcmd);
//需要打开的地方插入此段代码
shellexecute(intptr.zero, new stringbuilder("open"), new stringbuilder("test.exe"), new stringbuilder(""), new stringbuilder(@"c:\文件夹名"), 1);
上一篇: 皇帝欲想提拔此人当秘书,为什么遭到拒绝?