Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
ikylin committed May 9, 2013
1 parent 4f45c84 commit 91dc615
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 39 deletions.
Binary file modified xici/bin/xici.exe
Binary file not shown.
Binary file modified xici/src/UNIT/HtmlHelper.dcu
Binary file not shown.
1 change: 0 additions & 1 deletion xici/src/UNIT/HtmlHelper.pas
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,3 @@ function GetWebBrowserHtmlTableHtml(const AWebBrowser: TWebBrowser;
end;

end.

Binary file modified xici/src/UNIT/MainFrame.dcu
Binary file not shown.
35 changes: 17 additions & 18 deletions xici/src/UNIT/MainFrame.dfm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
object Form1: TForm1
Left = 162
Top = 20
Left = 400
Top = 164
Width = 897
Height = 848
Height = 662
Caption = #20054#20054#20195#29702#39564#35777#22120
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Expand Down Expand Up @@ -341,7 +341,7 @@ object Form1: TForm1
object action: TButton
Left = 80
Top = 72
Width = 97
Width = 73
Height = 25
Caption = #21152#36733#39029#38754
TabOrder = 1
Expand All @@ -357,37 +357,28 @@ object Form1: TForm1
end
object WebBrowser1: TWebBrowser
Left = 8
Top = 112
Top = 104
Width = 873
Height = 697
Height = 521
TabOrder = 3
ControlData = {
4C0000003A5A0000094800000000000000000000000000000000000000000000
4C0000003A5A0000D93500000000000000000000000000000000000000000000
000000004C000000000000000000000001000000E0D057007335CF11AE690800
2B2E126208000000000000004C0000000114020000000000C000000000000046
8000000000000000000000000000000000000000000000000000000000000000
00000000000000000100000000000000000000000000000000000000}
end
object Button1: TButton
Left = 192
Left = 168
Top = 72
Width = 89
Width = 73
Height = 25
BiDiMode = bdLeftToRight
Caption = #27979#35797#20195#29702
ParentBiDiMode = False
TabOrder = 4
OnClick = Button1Click
end
object Button2: TButton
Left = 824
Top = 72
Width = 57
Height = 25
Caption = #20572#27490
TabOrder = 5
OnClick = Button2Click
end
object IdHTTP1: TIdHTTP
MaxLineAction = maException
ReadTimeout = 0
Expand All @@ -413,4 +404,12 @@ object Form1: TForm1
Left = 320
Top = 80
end
object OpenDialog1: TOpenDialog
Left = 696
Top = 80
end
object IdAntiFreeze1: TIdAntiFreeze
Left = 600
Top = 96
end
end
130 changes: 110 additions & 20 deletions xici/src/UNIT/MainFrame.pas
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ interface
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdHTTP, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdSSLOpenSSLHeaders, IdIOHandler, IdIOHandlerSocket,
IdSSLOpenSSL, RegExpr, HtmlHelper, MSHTML, SHDocVw, OleCtrls;
IdSSLOpenSSL, RegExpr, HtmlHelper, MSHTML, SHDocVw, OleCtrls,
IdAntiFreezeBase, IdAntiFreeze;

type
TForm1 = class(TForm)
Expand All @@ -19,10 +20,15 @@ TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Button2: TButton;
OpenDialog1: TOpenDialog;
IdAntiFreeze1: TIdAntiFreeze;
procedure actionClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ Private declarations }
protected
Expand All @@ -38,10 +44,11 @@ TForm1 = class(TForm)
public
{ Public declarations }
end;

var
Form1: TForm1;
checkFlag:Boolean;
checkFlag: Boolean;
pauseFlag: Boolean;

implementation

Expand Down Expand Up @@ -259,7 +266,7 @@ function TForm1.GetProxyInfos(TextToCheck: string): Integer;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
var
ID: THandle;
doc: IHTMLDocument2;
begin
Expand All @@ -284,25 +291,38 @@ procedure TForm1.checkProxys(doc: IHTMLDocument2);

table := list.item(0, 0) as IHTMLTable;

for i := 1 to table.rows.length do
i := 1;
while i < table.rows.length - 1 do
//for i := 1 to 10 do
begin
if not checkFlag then Exit;
row := table.rows.item(i, i) as IHTMLTableRow;
cell := row.cells.item(0, 0) as IHTMLElement;
//ShowMessage(cell.innerText);
cell.innerText := '检测中'; //去掉图标
Application.ProcessMessages;

ip := row.cells.item(1, 1) as IHTMLElement;
port := row.cells.item(2, 2) as IHTMLElement;
isOk := testProxyByUrl(ip.innerText, StrToInt(Trim(port.innerText)), testUrl.Text);
if isOk then
cell.innerText := '可用==>' //去掉图标
if pauseFlag then begin
Application.ProcessMessages;
Sleep(300);
end
else
cell.innerText := '无效'; //去掉图标;

Application.ProcessMessages;
begin
row := table.rows.item(i, i) as IHTMLTableRow;
cell := row.cells.item(0, 0) as IHTMLElement;
//ShowMessage(cell.innerText);
cell.innerText := '检测中'; //去掉图标
Application.ProcessMessages;

ip := row.cells.item(1, 1) as IHTMLElement;
port := row.cells.item(2, 2) as IHTMLElement;
isOk := testProxyByUrl(ip.innerText, StrToInt(Trim(port.innerText)), testUrl.Text);
if isOk then
cell.innerText := '可用==>' //去掉图标
else
cell.innerText := '无效'; //去掉图标;

Application.ProcessMessages;
Sleep(1000);

//if (i mod StrToInt(batNum.Text)) = 0 then
//pauseFlag := True;
i := i + 1;
end;
end;
end;

Expand All @@ -312,5 +332,75 @@ procedure TForm1.Button2Click(Sender: TObject);
checkFlag := False;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
pauseFlag := True;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
pauseFlag := False;
end;

procedure TForm1.Button5Click(Sender: TObject);
var
i: Integer;
lstSplit: TStringList;
line: string;
rText: TextFile;
ip, port: string;
isOk: Boolean;
begin
if OpenDialog1.Execute then
begin
if FileExists(OpenDialog1.FileName) then
begin
i := 1;
AssignFile(rText, OpenDialog1.FileName);
reset(rText);
checkFlag := True;
while not EOF(rText) do


begin
readln(rText, line);
//Edit1.Text := IntToStr(i);
lstSplit := TStringList.Create;
lstSplit.Delimiter := ' ';
lstSplit.DelimitedText := line;

ip := lstSplit.Strings[0];
port := lstSplit.Strings[1];
isOk := testProxyByUrl(ip, StrToInt(Trim(port)), testUrl.Text);
if isOk then
begin
//Edit1.Text := {Edit1.Text + '//' + }Trim(ip) + ':' + Trim(port) + ' ' + lstSplit.Strings[2] + lstSplit.Strings[3];
//pauseFlag := True;
end;
Application.ProcessMessages;
Sleep(1000);
{
if (i mod StrToInt(batNum.Text)) = 0 then
pauseFlag := True;
while pauseFlag do
begin
Application.ProcessMessages;
Sleep(300);
if not checkFlag then
Exit;
end; }
i := i +1;
end
end;
closefile(rText);
end;
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
pauseFlag := False;
end;

end.

Binary file modified xici/src/UNIT/RegExpr.dcu
Binary file not shown.

0 comments on commit 91dc615

Please sign in to comment.