
import console;
import fsys;
import godking.http;
var url = "https://dldir1v6.qq.com/qqfile/qq/PCQQ9.7.25/QQ9.7.25.29417.exe";
var startinfo = {};
var data,header,result = godking.http({
url = url;
file = "C:\Users\Administrator\Desktop\QQ9.7.25.29417.exe";
callback = function(callbackID,已下载大小,总大小,网址,本地文件名){
if !startinfo.time {
startinfo.time = time.tick();
startinfo.size = 已下载大小;
}
if 已下载大小===-1 and 总大小===-1 console.log("下载完毕!");
else {
var time = (time.tick()-startinfo.time)/1000;
var size = 已下载大小-startinfo.size;
if time>0 {
console.dump("下载时间:" ++ time ++ "秒");
console.dump("下载大小:" ++ fsys.formatSize(size));
console.dump("下载速度:" ++ fsys.formatSize(math.round(size/time,0)) ++ "/秒");
}
console.dump("下载进度:" ++ math.round(已下载大小*100/总大小,2) ++ "%",'\n');
}
}
append = true;
})
if (result.success) {
console.logPause("文件已下载完成,请自行验证文件完整性!");
} else {
console.logPause("下载错误:"++result.info);
}