To 我想在c#中执行ShellExecute这个API函数,可是不知道怎么办? [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("notepad"), new StringBuilder(""), new StringBuilder(@"C:\"), 1);不过还是建议用Process.Start()。
[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("notepad"),
new StringBuilder(""),
new StringBuilder(@"C:\"), 1);不过还是建议用Process.Start()。