| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using CommonTool;
- namespace SysConfigTool
- {
- public partial class XyhConfigTool : UserControl
- {
- private readonly string _fileName;
- private readonly string _fileCode;
- public XyhConfigTool()
- {
- InitializeComponent();
- _fileName = "RSDB.cfg";
- _fileCode = "qwertyuiopasdfgh";
- string path = Environment.CurrentDirectory;
- string filePath = path.Substring(0, path.IndexOf("\\bin", StringComparison.Ordinal));
- FileFuns.AddSeachingFolder(filePath);
- txt.Text = ReadConfig();
- }
- private void btn_read_Click(object sender, EventArgs e)
- {
- txt.Text = ReadConfig();
- }
- private void btn_save_Click(object sender, EventArgs e)
- {
- FileFuns.SaveConnectionString(txt.Text);
- }
- private string ReadConfig()
- {
- return FileFuns.ReadEncryptedFile(_fileName, _fileCode);
- }
- }
- }
|