孙世强
2025-11-20 c82db51f2df281afe54c08dd55cb049693e5a889
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace 补片
{
    public partial class FrmSet : Form
    {
        public FrmSet()
        {
            InitializeComponent();
        }
 
        private void FrmSet_Load(object sender, EventArgs e)
        {
            InitShow();
        }
 
        void InitShow() {
            txtServerIP.Text = BuPianBll.ServerIP;
            txtMesIP.Text = BuPianBll.MesServerIP;
            txtMainName.Text = BuPianBll.MainName;
            txtVersion.Text = BuPianBll.Version;
            txtPosition.Text = BuPianBll.Position;
        }
 
        private void Button_MouseEnter(object sender, EventArgs e)
        {
            ((Control)sender).BackColor = Color.FromArgb(213, 234, 255);
            ((Control)sender).ForeColor = Color.FromArgb(92, 173, 254);
        }
        private void Button_MouseLeave(object sender, EventArgs e)
        {
            ((Control)sender).BackColor = Color.FromArgb(92, 173, 254);
            ((Control)sender).ForeColor = Color.FromArgb(213, 234, 255);
        }
 
        private void lblBtnSure_Click(object sender, EventArgs e)
        {
            if (UpdateSet())
            {
                this.DialogResult = DialogResult.OK;
            };
        }
 
        Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
        bool  UpdateSet()
        {
            try
            {
 
                BuPianBll.ServerIP = cfa.AppSettings.Settings["ServerIP"].Value = txtServerIP.Text.Trim();
                BuPianBll.MesServerIP = cfa.AppSettings.Settings["MesServerIP"].Value = txtMesIP.Text.Trim();
                BuPianBll.MainName = cfa.AppSettings.Settings["MainName"].Value = txtMainName.Text.Trim();
                BuPianBll.Version = cfa.AppSettings.Settings["Version"].Value = txtVersion.Text.Trim();
                BuPianBll.Position = cfa.AppSettings.Settings["Position"].Value = txtPosition.Text.Trim();
                cfa.Save();
                return true;
            }
            catch (Exception ex)
            {
                return false; 
            }
            
        }
 
        private void lblVerision_Click(object sender, EventArgs e)
        {
           
        }
 
        private void lblVerision_DoubleClick(object sender, EventArgs e)
        {
            txtVersion.ReadOnly = !txtVersion.ReadOnly;
        }
 
        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}