private void ResetTime_Button_Click(object sender, RoutedEventArgs e) { string strShutDownTime = ShuDownTime_Edit.Text; // if (bReset == true) // { // bReset = false; // string strShutDownTimeDefault = ConfigurationManager.AppSettings["DefaultShutDownTime"]; // ShuDownTime_Edit.Text = strShutDownTimeDefault; // strShutDownTime = strShutDownTimeDefault; // ResetTime_Button.Content = @"确认"; // } Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); cfa.AppSettings.Settings["ShutDownTime"].Value = strShutDownTime; cfa.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection("appSettings"); CommonFuntion common = new CommonFuntion(); common.setWindowsShutDown(); }
private void setWindowsShutDown() { CommonFuntion pCommon = new CommonFuntion(); pCommon.setWindowsShutDown(); }