using System.Runtime.InteropServices;


[DllImport("Shell32.dll", EntryPoint = "#61", CharSet = CharSet.Ansi)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SHRunFileDialog(IntPtr hWnd,
IntPtr hIcon,
[MarshalAs(UnmanagedType.LPStr)]string directory,
[MarshalAs(UnmanagedType.LPTStr)] string title,
[MarshalAs(UnmanagedType.LPTStr)] string prompt,
UInt32 uFlags);


private void button1_Click(object sender, EventArgs e)
{
SHRunFileDialog(this.Handle, this.Icon.Handle, Environment.CurrentDirectory, "运行", "输入文件名,windows将运行响应的程序", 0);
}


编辑器加载中...

相关文章:

  • 2021-09-20
  • 2021-04-10
  • 2022-12-23
  • 2021-04-20
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案