private void btnDirAC_Click(object sender, EventArgs e) { string path = ""; if (txtACEXE.Text.Equals("")) { path = ACHelper.getACSFolder(); } else { path = Path.GetFullPath(txtACEXE.Text); } OpenFileDialog openfile = new OpenFileDialog(); openfile.CheckFileExists = true; openfile.FileName = "AssettoCorsa.exe"; openfile.InitialDirectory = path; DialogResult dlgRes = openfile.ShowDialog(); if (dlgRes == DialogResult.OK) { if (File.Exists(openfile.FileName) && openfile.FileName.Contains("AssettoCorsa.exe")) { this.txtACEXE.Text = openfile.FileName; SaveSettings(); } } }
/// <summary> /// Lädt die Einstelungen aus den Usersettings /// </summary> private void LoadSettings() { txtFTP.Text = AC_SRU_Sync.Properties.Settings.Default.ftpPath; txtACEXE.Text = AC_SRU_Sync.Properties.Settings.Default.localPath; if (txtACEXE.Text.Equals("")) { txtACEXE.Text = ACHelper.getACSFolder() + @"\AssettoCorsa.exe"; } txtFtpUser.Text = AC_SRU_Sync.Properties.Settings.Default.ftpUser; pnlSettings.Visible = AC_SRU_Sync.Properties.Settings.Default.SettingsVisible; btnShowSettings.Text = pnlSettings.Visible ? "-" : "+"; if (!AC_SRU_Sync.Properties.Settings.Default.ftpPassword.Equals("")) { txtFtpPassword.Text = simpleAES.DecryptString(AC_SRU_Sync.Properties.Settings.Default.ftpPassword); } else { txtFtpPassword.Text = ""; } if (AC_SRU_Sync.Properties.Settings.Default.deep > 3) { deepToCheck = AC_SRU_Sync.Properties.Settings.Default.deep; } cmbDeep.Value = deepToCheck; btnSync.Enabled = false; btnStart.Enabled = false; checkBoxes = new Dictionary <int, CheckBox>(); checkBoxes.Add(0, checkBox1); checkBoxes.Add(1, checkBox2); checkBoxes.Add(2, checkBox3); checkBoxes.Add(3, checkBox4); checkBoxes.Add(4, checkBox5); checkBoxes.Add(5, checkBox6); checkBoxes.Add(6, checkBox7); checkBoxes.Add(7, checkBox8); LoadMainDirsFromSettings(); isLoading = false; }