-
Notifications
You must be signed in to change notification settings - Fork 0
/
Unit1.pas
99 lines (86 loc) · 2.1 KB
/
Unit1.pas
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
98
99
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs,idHttp,RegularExpressionsAPI,RegularExpressionsCore,
RegularExpressionsConsts,RegularExpressions, Vcl.StdCtrls, Vcl.Menus,
Vcl.ExtCtrls, Vcl.ComCtrls, Vcl.ToolWin;
type
TForm1 = class(TForm)
Panel1: TPanel;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
ListBox1: TListBox;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
procedure ToolButton1Click(Sender: TObject);
private
procedure Start();
RegularExpressionsConsts,RegularExpressions,Proxy;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var
Reg:TRegEx;
Http:TIdHttp;
FS:TStringList;
InputFile:TStringList;
i:Integer;
Addr:String;
InText:Integer;
procedure TForm1.Start();
begin
FS:=TStringList.Create;
InputFile:=TStringList.Create;
http:=TIdHttp.Create;
http.Request.UserAgent :='Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)';
InputFile.LoadFromFile('/Users/mas/Documents/ProxyChecker/dHidder/proxy.txt');
for i:=0 to inputfile.Count-1 do begin
Addr:=InputFile.Strings[i];
InText:= Pos(':', Addr);
http.Get('213.180.204.3');
end;
end;
function Add(Pattern:String):TStrings;
var
Str:TStrings;
text:String;
begin
Str:=TStringList.Create;
reg.Create(Pattern);
http:=TIdHttp.Create;
text:=http.Get('http://free-proxy-list.net/');
if Reg.IsMatch(Text) then
begin
for i:=0 to Reg.Matches(Text).Count-1 do
begin
Str.Add(Reg.Matches(Text).Item[i].Value);
end;
end;
Result:=Str;
FreeAndNil(Str);
FreeAndNil(Reg);
FreeAndNil(Http);
end;
procedure TForm1.ToolButton1Click(Sender: TObject);
var
reg:TRegex;
i:integer;
begin
listbox1.Clear;
listbox1.Items.AddStrings(Add('[\d]{1,3}[.][\d]{1,3}[.][\d]{1,3}[.][\d]{1,3}'));
end;
end.