using Api.Framework; 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 循环的发消息 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public void CloseForm() { try { if (!this.IsDisposed) { this.Invoke(new Action(delegate { this.Close(); this.Dispose(); })); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void Form1_Load(object sender, EventArgs e) { this.numericUpDown1.Value = Class1.Config.Num; this.numericUpDown2.Value = Class1.Config.Sleep; this.richTextBox1.Text = Class1.Config.Users; this.richTextBox2.Text = Class1.Config.Content; } private void button1_Click(object sender, EventArgs e) { Class1.Config.Num = (int)numericUpDown1.Value; Class1.Config.Sleep = (int)numericUpDown2.Value; Class1.Config.Users = richTextBox1.Text; Class1.Config.Content = richTextBox2.Text; Api.Framework.Tools.Util.Save(Class1.Config); } } }