Esempio n. 1
0
 private void rbtnSet2_CheckedChanged(object sender, EventArgs e)
 {
     if (rbtnSet2.Checked)
     {
         RWconfig.SetAppSettings("machineType", "1");
     }
 }
Esempio n. 2
0
 private void tsBtnSave_Click(object sender, EventArgs e)
 {
     RWconfig.SetAppSettings("Y1", this.tscbY1.SelectedIndex.ToString());
     RWconfig.SetAppSettings("Y2", this.tscbY2.SelectedIndex.ToString());
     RWconfig.SetAppSettings("X1", this.tscbX1.SelectedIndex.ToString());
     RWconfig.SetAppSettings("X2", this.tscbX2.SelectedIndex.ToString());
 }
Esempio n. 3
0
 private void btnSaveBXZengyi_Click(object sender, EventArgs e)
 {
     if (txtBXZengyi.Text != string.Empty)
     {
         if (double.Parse(txtBXZengyi.Text.Trim()) != 0)
         {
             RWconfig.SetAppSettings("BXZengyi", txtBXZengyi.Text);
             MessageBox.Show("保存成功!");
         }
         else
         {
             MessageBox.Show("请输入不为0数字");
         }
     }
     else
     {
         MessageBox.Show("请输入数字");
     }
 }
Esempio n. 4
0
        // Function to Generate a 64 bits Key.
        /// <summary>
        /// 创建加密
        /// </summary>
        /// <returns></returns>
        public static string GenerateKey()
        {
            // Create an instance of Symetric Algorithm. Key and IV is generated automatically.
            DESCryptoServiceProvider desCrypto = (DESCryptoServiceProvider)DESCryptoServiceProvider.Create();

            //string curveName = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\key.txt";
            //StreamWriter sw = new StreamWriter(curveName);
            if (string.IsNullOrEmpty(RWconfig.GetAppSettings("code")))
            {
                string ss = BitConverter.ToString(desCrypto.Key);
                RWconfig.SetAppSettings("code", ss.ToString());
            }
            //sw.WriteLine(BitConverter.ToString(desCrypto.Key));
            //sw.Close();
            //sw.Dispose();
            //RWconfig.SetAppSettings("code",BitConverter.ToString(desCrypto.Key));
            // Use the Automatically generated key for Encryption.
            return(ASCIIEncoding.ASCII.GetString(desCrypto.Key));
        }
Esempio n. 5
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtMinLoad.Text))
     {
         try
         {
             float minload = float.Parse(txtMinLoad.Text);
             if (minload < 0.05 || minload > 2)
             {
                 MessageBox.Show("请输入 0.05 - 2 之间的数值,已恢复默认值!");
                 return;
             }
             else
             {
                 RWconfig.SetAppSettings("minLoad", txtMinLoad.Text);
                 MessageBox.Show("保存成功!");
             }
         }
         catch
         {
             MessageBox.Show("输入不正确,已恢复成默认值!");
         }
     }
 }
Esempio n. 6
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     RWconfig.SetAppSettings("ShowY", this.cmbYr.SelectedIndex.ToString());
     RWconfig.SetAppSettings("ShowX", this.cmbXr.SelectedIndex.ToString());
 }