-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnti.pas
136 lines (122 loc) · 3.15 KB
/
Anti.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
unit Anti;
interface
uses
Windows, Forms,
param, ExtCtrls, StdCtrls, ComCtrls, Controls, Classes;
type
TAntiv = class(TForm)
Label1: TLabel;
Memo1: TMemo;
ProgressBar1: TProgressBar;
Timer1: TTimer;
Timer2: TTimer;
Button1: TButton;
procedure Timer1Timer(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Antiv: TAntiv;
n, r:integer;
implementation
uses Main, Soft;
{$R *.dfm}
procedure TAntiv.Timer1Timer(Sender: TObject);
begin
inc(n);
If n=1 then
Memo1.Lines.Add('Çâîíèì ïî íîìåðó '+Telefon);
If n=2 then
Memo1.Lines.Add('Ïîäêëþ÷åíèå...');
If n=4 then
Memo1.Lines.Add('Ñîåäèíåíèå ñ ñàéòîì '+AntivirusServer);
If n=5 then begin
r:=random(4);
If r <> 2 then
Memo1.Lines.Add('Çàêà÷êà ôàéëîâ...')
else
begin
Timer1.Enabled:=false;
Timer2.Enabled:=false;
Application.MessageBox(Pchar('Îïåðàöèÿ îòìåíåíà â ñâÿçè ñ ðàçáîðîì ïîëåòîâ íà '+AntivirusServer),'Ïîìîùü!',MB_ICONSTOP);
n:=-1;
close;
end;
end;
If n=6 then begin
Timer2.Enabled:=true;
Timer1.Enabled:=false;
end;
If n=8 then begin
Memo1.Lines.Add('Çàêà÷êà ôàéëîâ çàâåðøåíà!');
If Parts[ActivePartition,0].Free>=10 then
Parts[ActivePartition,0].Free:=Parts[ActivePartition,0].Free-10
else
Memo1.Lines.Add('Îøèáêà! Íà æåñòêîì äèñêå íå õâàòàåò ìåñòà!');
end;
If n=9 then
Memo1.Lines.Add('Ðàññîåäèíèå...');
If n=10 then
Memo1.Lines.Add('Âñå îïåðàöèè óñïåøíî çàâåðøåíû!');
If n=11 then begin
n:=0;
InetTraffic:=InetTraffic-1;
if Parts[ActivePartition,0].Free>10 then
Antivirusbases:=Softw.Button4.Caption;
Close;
end;
end;
procedure TAntiv.Timer2Timer(Sender: TObject);
begin
ProgressBar1.Position:=ProgressBar1.Position+1;
If ProgressBar1.Position=50 then begin
n:=n+1;
Timer1.Enabled:=true;
Timer2.Enabled:=false;
end;
end;
procedure TAntiv.FormActivate(Sender: TObject);
begin
Randomize;
Memo1.Lines.Clear;
ProgressBar1.Position:=0;
Timer1.Interval:=1025-(inetSpeed div 1000);
Timer2.Interval:=1025-(inetSpeed div 1000);
Timer1.Enabled:=true;
n:=0;
MainForm.Timer1.Enabled:=false;
end;
procedure TAntiv.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Timer1.Enabled:=false;
Timer2.Enabled:=false;
AntivCOunt:=0;
end;
procedure TAntiv.Button1Click(Sender: TObject);
begin
Timer1.Enabled:=false;
Timer2.Enabled:=false;
If Application.MessageBox('Âû äåéñòâèòåëüíî õîòèòå ðàçîðâàòü ñîåäèíåíèå?','Óâåðåíû?',MB_YESNO+MB_ICONINFORMATION)=IDYES then begin
Timer1.Enabled:=false;
Timer2.Enabled:=false;
n:=-1;
CLose;
end;
Timer1.Enabled:=true;
Timer2.Enabled:=true;
end;
procedure TAntiv.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
If (key=VK_ESCAPE) then
Button1.OnClick(self);
end;
end.