old_flsystem/应用/提取xml连接/MainForm.cs

61 lines
1.3 KiB
C#

using Api.Framework.Tools;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace xml连接
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
public void CloseForm()
{
try
{
if (!this.IsDisposed)
{
this.Invoke(new Action(delegate
{
this.Close();
this.Dispose();
}));
}
}
catch (Exception ex)
{
}
}
private void MainForm_Load(object sender, EventArgs e)
{
textBox1.Text = Class1.Config.usernames;
}
private void button1_Click(object sender, EventArgs e)
{
try
{
Class1.Config.usernames = textBox1.Text;
Util.Save(Class1.Config);
MessageBox.Show($"成功");
}
catch (Exception ex)
{
MessageBox.Show($"异常:{ex.Message}");
}
}
}
}