-
Notifications
You must be signed in to change notification settings - Fork 7
/
UserInterface.cs
97 lines (87 loc) · 3.33 KB
/
UserInterface.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Fiddler;
namespace FPDDiger
{
class UserInterface : UserControl
{
private TabPage tabPage;
private CheckBox chkb_Enabled;
private TextBox textBox_Result;
private Button btn_Clear;
private LinkLabel linkLabel;
public bool bEnabled;
public delegate void Delegate_AddResult(string strUrl);
public UserInterface()
{
this.bEnabled = false;
this.InitializeUI();
FiddlerApplication.UI.tabsViews.TabPages.Add(this.tabPage);
}
public void InitializeUI()
{
this.tabPage = new TabPage("爆路径检测");
this.tabPage.AutoScroll = true;
this.chkb_Enabled = new CheckBox();
this.chkb_Enabled.Top = 10;
this.chkb_Enabled.Left = 20;
this.chkb_Enabled.Text = "Enable";
this.chkb_Enabled.Checked = false;
this.btn_Clear = new Button();
this.btn_Clear.Text = "Clear";
this.btn_Clear.Left = 200;
this.btn_Clear.Top = 10;
this.Enabled = false;
this.textBox_Result = new TextBox();
this.textBox_Result.Top = 50;
this.textBox_Result.Left = 20;
this.textBox_Result.Width = 1000;
this.textBox_Result.Height = 600;
this.textBox_Result.ReadOnly = true;
this.textBox_Result.Multiline = true;
this.textBox_Result.ScrollBars = ScrollBars.Vertical;
this.linkLabel = new LinkLabel();
this.linkLabel.Text = "Her0in Team";
this.linkLabel.Top = this.textBox_Result.Bottom + 20;
this. linkLabel.Left = 500;
this.linkLabel.AutoSize = true;
this.linkLabel.TabStop = true;
this.tabPage.Controls.Add(this.chkb_Enabled);
this.tabPage.Controls.Add(this.btn_Clear);
this.tabPage.Controls.Add(this.linkLabel);
this.tabPage.Controls.Add(this.textBox_Result);
this.chkb_Enabled.CheckedChanged += new EventHandler(this.chkb_Enabled_CheckedChanged);
this.btn_Clear.Click += new EventHandler(this.btn_Clear_Clicked);
this.linkLabel.Click += new EventHandler(this.linkLabel_Clicked);
}
private void linkLabel_Clicked(object obj, EventArgs args)
{
System.Diagnostics.Process.Start("http://www.her0in.org/");
}
private void btn_Clear_Clicked(object obj, EventArgs args)
{
this.textBox_Result.Text = "";
}
private void chkb_Enabled_CheckedChanged(object obj, EventArgs args)
{
this.SuspendLayout();
this.bEnabled = this.chkb_Enabled.Checked;
this.btn_Clear.Enabled = this.bEnabled;
this.ResumeLayout();
}
public void AddResult(string strUrl)
{
if (!this.textBox_Result.InvokeRequired)
this.textBox_Result.AppendText(strUrl + "\r\n");
else
{
Delegate_AddResult delegate_addresult = new Delegate_AddResult(this.AddResult);
this.textBox_Result.Invoke(delegate_addresult, strUrl);
}
}
}
}