void OpenFolder() { var dialog = new CommonOpenFileDialog(); dialog.IsFolderPicker = true; if (CommonFileDialogResult.Ok == dialog.ShowDialog()) { string path = dialog.FileName; new Thread(() => { ProcessExecutor.ExecuteSilent(System.AppDomain.CurrentDomain.BaseDirectory + "imgmerge.exe", "-l " + path); }).Start(); } }
void AppendPic() { OpenFileDialog ofd = new OpenFileDialog(); //设置打开的文件的类型,注意过滤器的语法 ofd.Filter = "jpg文件|*.jpg|jpeg文件|*.jpeg|tif文件|*.tif"; //调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮 if (ofd.ShowDialog() == true) { ProcessExecutor.ExecuteSilent(System.AppDomain.CurrentDomain.BaseDirectory + "imgmerge.exe ", "-a " + ofd.FileName); } else { MessageBox.Show("没有选择图片"); } }