private void buttonExLauncherEXEbrowse_Click(object sender, EventArgs e) { using (OpenFileDialog ofd = new OpenFileDialog()) { ofd.Title = "Select target"; DialogFileFilterBuilder ffi = new DialogFileFilterBuilder(); ffi.Append("Any programs/script", "*.exe", "*.bin", "*.bat"); ffi.Append("Any files", "*"); ofd.Filter = ffi.ToFileFilterString(); ofd.CheckFileExists = true; ofd.CheckPathExists = true; ofd.Multiselect = false; ofd.RestoreDirectory = true; if (ofd.ShowDialog(this) == DialogResult.OK) { string laiwhgliahwg = Leayal.AppInfo.AssemblyInfo.DirectoryPath + "\\"; if (ofd.FileName.StartsWith(laiwhgliahwg)) { this.textBoxExLauncherEXE.Text = ofd.FileName.Remove(0, laiwhgliahwg.Length); } else { this.textBoxExLauncherEXE.Text = ofd.FileName; } } } }
private void optionbuttonBrowseBG_Click(object sender, EventArgs e) { using (OpenFileDialog ofd = new OpenFileDialog()) { ofd.Title = "Select background image location"; ofd.SupportMultiDottedExtensions = false; ofd.RestoreDirectory = true; ofd.AutoUpgradeEnabled = true; ofd.CheckFileExists = true; ofd.CheckPathExists = true; ofd.Multiselect = false; if (!string.IsNullOrWhiteSpace(optiontextBoxBGlocation.Text) && System.IO.File.Exists(optiontextBoxBGlocation.Text)) { ofd.FileName = optiontextBoxBGlocation.Text; } using (Leayal.Forms.DialogFileFilterBuilder dffb = new DialogFileFilterBuilder()) { dffb.AppendAllSupportedTypes = AppendOrder.Last; dffb.Append("Portable Network Graphics", "*.png"); dffb.Append("Bitmap Image", "*.bmp"); dffb.Append("JPEG Image", "*jpg", "*.jpeg"); ofd.Filter = dffb.ToFileFilterString(); ofd.FilterIndex = dffb.OutputCount; } if (ofd.ShowDialog(this) == DialogResult.OK) { this._appearenceChanged = true; optiontextBoxBGlocation.Text = ofd.FileName; } } }