/* * protected override CreateParams CreateParams { * get { * CreateParams handleparam = base.CreateParams; * handleparam.ExStyle |= 0x02000000; * return handleparam; * } * } */ private void Btn_OpenFolder_Click(object sender, EventArgs e) { FolderOpener.ShowDialog(); if (FolderOpener.SelectedPath.Length > 0) { path = FolderOpener.SelectedPath; filepaths = Directory.GetFiles(path); if (filepaths.Length > 0) { foreach (string file in filepaths) { if (file.EndsWith(".jpg") || file.EndsWith(".png") || file.EndsWith(".jpeg") || file.EndsWith(".jpe") || file.EndsWith(".jif") || file.EndsWith(".jfif") || file.EndsWith(".jfi")) { filenames.Add(Path.GetFileName(file)); } } filepaths = new string[0]; FolderOpener.Dispose(); if (filenames.Count > 0) { CreateImage(path + "\\" + (string)filenames[0]); ButtonSwitch(true); } else { MessageBox.Show("No se encontraron archivos de imagenes en el directorio seleccionado.", "aviso", MessageBoxButtons.OK); } } } }
public async Task <IActionResult> OnPostAsync() { if (ActiveProject != null && ProcessManager.IsRunning(ActiveProject)) { await Task.Run(() => { FolderOpener.Open(ProcessManager.GetLogFolder(ActiveProject)); }); } return(RedirectToPage("./Index")); }