📄 diaoyong.~pas
字号:
unit diaoyong;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ShellAPI,WinInet, jpeg, ExtCtrls,FileCtrl,shlobj,Registry;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Button1: TButton;
Label2: TLabel;
Label3: TLabel;
Button2: TButton;
Label8: TLabel;
Label9: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function GetCookiesFolder:string;
var
pid1:pitemIDList;
buffer:array[0..255] of char;
begin
SHGetSpecialFolderLocation(application.Handle,CSIDL_COOKIES,pid1);
SHGetPathFromIDList(pid1,buffer);
result:=strpas(buffer);
end;
function shellDeleteFile(sFileName:string):boolean;
var
FOS:TSHFileOpstruct;
begin
FillChar(FOS,SizeOf(FOS),0);
with FOS do
begin
wFunc:=FO_DELETE;
pFrom:=PChar(sFileName);
fFlags:=FOF_NOCONFIRMATION;
end;
Result:=(SHFileOperation(FOS)=0);
end;
procedure DelCookie;
var
dir:string;
begin
InternetSetOption(nil,INTERNET_OPTION_END_BROWSER_SESSION,nil,0);
dir:=GetCookiesFolder;
ShellDeleteFile(dir+'\*.txt');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
num,i:Integer;
startinfo:TStartupInfo;
processinfo:TProcessInformation;
num1:string;
begin
edit1.Enabled:=false;
button1.Enabled:=false;
// writeln('code by xiaobai');
// write('请输入投票次数: ');
// read(num);
num1:=trim(Edit1.Text);
num:=strtointdef(num1,1000);
i:=0;
while(i<num) do
begin
GetStartupInfo(startinfo);
// startinfo.dwFlags := STARTF_USESHOWWINDOW or STARTF_USESTDHANDLES;
// startinfo.wShowWindow := SW_HIDE;
try
if not (CreateProcess(nil, 'vote.exe', nil, nil, TRUE, CREATE_NO_WINDOW, nil, nil, startinfo, processinfo)) then
begin
// ShowMessage('Create process error!');
exit;
end;
// CloseHandle(processinfo.hProcess);
Sleep(1000);
// writeln(i);
except
end;
i:=i+1;
label3.Caption :=inttostr(i);
DelCookie;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if MessageDlg('是否确定要离开自动投票系统?',
mtConfirmation, [mbYes, mbNo], 0) = mrYes then
application.Terminate ;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -