You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.5 KiB
74 lines
2.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Microsoft.VisualBasic;
|
|
namespace ControlSystem
|
|
{
|
|
/// <summary>
|
|
/// Creator:Richard.liu
|
|
/// ºÚÏ»×Óά»¤
|
|
/// </summary>
|
|
public partial class FrmDarkCasket : Form
|
|
{
|
|
private static FrmDarkCasket _formInstance;
|
|
|
|
public static FrmDarkCasket FormInstance
|
|
{
|
|
get
|
|
{
|
|
if (_formInstance == null)
|
|
{
|
|
_formInstance = new FrmDarkCasket();
|
|
}
|
|
return _formInstance;
|
|
}
|
|
set { _formInstance = value; }
|
|
}
|
|
public FrmDarkCasket()
|
|
{
|
|
InitializeComponent();
|
|
_formInstance = this;
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (Information.IsNumeric(this.tbDarkCasketDays.Text.Trim()) == false)
|
|
{
|
|
MessageBox.Show("ºÚÏ»×ÓÎļþµÄ±£Áô¸öÊý±ØÐëÊÇÊý×Ö£¡", "²Ù×÷Ìáʾ£º", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
this.tbDarkCasketDays.Focus();
|
|
return;
|
|
}
|
|
if (Information.IsNumeric(this.tbDarkCasketSize.Text.Trim()) == false)
|
|
{
|
|
MessageBox.Show("ºÚÏ»×ÓÎļþ´óСµÄ×î´óÖµ±ØÐëÊÇÊý×Ö£¡", "²Ù×÷Ìáʾ£º", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
this.tbDarkCasketSize.Focus();
|
|
return;
|
|
}
|
|
double ssize;
|
|
ssize = 1048576 * Convert.ToDouble( this.tbDarkCasketSize.Text);
|
|
CommonClassLib.AppSettings.SetValue("DarkCasketSize", ssize.ToString());
|
|
CommonClassLib.AppSettings.SetValue("DarkCasketSum", this.tbDarkCasketDays.Text);
|
|
MessageBox.Show("±£´æ³É¹¦£¡", "²Ù×÷Ìáʾ£º", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
|
this.Close();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
private void FrmDarkCasket_Load(object sender, EventArgs e)
|
|
{
|
|
//20100521
|
|
this.tbDarkCasketDays.Text=CommonClassLib.AppSettings.GetValue("DarkCasketSum");
|
|
this.tbDarkCasketSize.Text = Convert.ToString(Convert.ToDouble( CommonClassLib.AppSettings.GetValue("DarkCasketSize")) / 1048576);
|
|
}
|
|
}
|
|
}
|