-
Notifications
You must be signed in to change notification settings - Fork 600
/
Copy pathFormVersionControl.cs
64 lines (58 loc) · 1.67 KB
/
FormVersionControl.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using HslCommunication.BasicFramework;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CommonLibrary
{
/// <summary>
/// 控制版本号的窗口类
/// </summary>
public partial class FormVersionControl : Form
{
/// <summary>
///
/// </summary>
/// <param name="settings"></param>
public FormVersionControl(ServerSettings settings)
{
InitializeComponent();
Settings = settings;
}
private ServerSettings Settings = null;
private void FormVersionControl_Shown(object sender, EventArgs e)
{
textBox1.Text = Settings.SystemVersion.ToString();
textBox2.Focus();
}
private void userButton1_Click(object sender, EventArgs e)
{
try
{
Settings.SystemVersion = new SystemVersion(textBox2.Text);
}
catch(Exception ex)
{
MessageBox.Show("版本号格式错误:应为1.0.0" + Environment.NewLine +
"错误描述:" + ex.Message);
}
try
{
Settings.SaveToFile();
MessageBox.Show("保存成功");
}
catch(Exception ex)
{
MessageBox.Show("数据保存失败" + Environment.NewLine +
"错误描述:" + ex.Message);
}
}
private void FormVersionControl_Load(object sender, EventArgs e)
{
}
}
}