-
Notifications
You must be signed in to change notification settings - Fork 54
/
EditQL.cs
70 lines (58 loc) · 1.76 KB
/
EditQL.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
65
66
67
68
69
70
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 JD_Get
{
public partial class EditQL : Form
{
Form1 form { set; get; }
public EditQL(Form1 form)
{
InitializeComponent();
this.form=form;
}
private void button1_Click(object sender, EventArgs e)
{
if (!ConfigHelp.IsValidUri(QL_URL.Text)) {
MessageBox.Show("青龙地址非网址");
return;
}
ConfigHelp.SetSetting("QL_URL", QL_URL.Text);
ConfigHelp.SetSetting("QL_ClientID", QL_ClientID.Text);
ConfigHelp.SetSetting("QL_ClientSecret", QL_ClientSecret.Text);
form.GetQLConfig();
this.Close();
}
private void EditQL_Load(object sender, EventArgs e)
{
var ql= new QLHelp();
this.QL_URL.Text = ql.Url;
this.QL_ClientID.Text = ql.ClientID;
this.QL_ClientSecret.Text = ql.ClientSecret;
}
private void button2_Click(object sender, EventArgs e)
{
var testQL = new QLHelp()
{
ClientID= QL_ClientID.Text,
ClientSecret= QL_ClientSecret.Text,
Url = QL_URL.Text,
};
try
{
string token = testQL.Login();
MessageBox.Show("测试通过");
}
catch(Exception ex)
{
MessageBox.Show("参数存在错误"+ex.Message);
}
}
}
}