如下可以调用迅雷直接下载文件,如果我想用javascript调出迅雷的下载进度,文件大小等等,怎么调呢?<script language="javascript">
var a,b,c,d,e,f;
a = "ftp://down1.x8k8.com/0711/变形金刚真人版斯皮尔伯格监制][TS-RMVB535MB][英语中字][/[www.x8k8.com]免费电影下载网-变形金刚cd1.rmvb";
b = "test";
c = "D:\\my source\\5.动人MUSIC\\变形金刚";
d = "strCID";
e = "strStatUrl";
f = "strCookie";
var ThunderAgent = new ActiveXObject("ThunderAgent.Agent");AddLink(a,b,c,d,e,f);
function AddLink(Url,Info,Location,strCID,strStatUrl,strCookie)
{
if (Url != "")
{
if (Info == "")
{
Info = "unknown";
}
if (strCID != "")
{
if (strStatUrl != "")
{
ThunderAgent.AddTask5(Url, "", "", Info, Location, -1, 0, -1, strCookie, strCID, strStatUrl, 1, "", -1);
}
else
{
ThunderAgent.AddTask5(Url, "", "", Info, Location, -1, 0, -1, strCookie, strCID, "", 1, "", -1);
}
}
else
{
ThunderAgent.AddTask5(Url, "", "", Info, Location,-1,0,-1,strCookie,"","", 1, "", -1);
}
ThunderAgent.CommitTasks2(1);
}
}</script>
var a,b,c,d,e,f;
a = "ftp://down1.x8k8.com/0711/变形金刚真人版斯皮尔伯格监制][TS-RMVB535MB][英语中字][/[www.x8k8.com]免费电影下载网-变形金刚cd1.rmvb";
b = "test";
c = "D:\\my source\\5.动人MUSIC\\变形金刚";
d = "strCID";
e = "strStatUrl";
f = "strCookie";
var ThunderAgent = new ActiveXObject("ThunderAgent.Agent");AddLink(a,b,c,d,e,f);
function AddLink(Url,Info,Location,strCID,strStatUrl,strCookie)
{
if (Url != "")
{
if (Info == "")
{
Info = "unknown";
}
if (strCID != "")
{
if (strStatUrl != "")
{
ThunderAgent.AddTask5(Url, "", "", Info, Location, -1, 0, -1, strCookie, strCID, strStatUrl, 1, "", -1);
}
else
{
ThunderAgent.AddTask5(Url, "", "", Info, Location, -1, 0, -1, strCookie, strCID, "", 1, "", -1);
}
}
else
{
ThunderAgent.AddTask5(Url, "", "", Info, Location,-1,0,-1,strCookie,"","", 1, "", -1);
}
ThunderAgent.CommitTasks2(1);
}
}</script>
// BitThunder object
//----------------------------------------------------------------------------
function BigThunder()
{
this.$();
}
BigThunder.prototype = {
$:
function ()
{
if (typeof(this._o) == 'undefined')
try {
BigThunder.prototype._o = new ActiveXObject("ThunderAgent.Agent");
} catch (e) {
try {
BigThunder.prototype._o = new ActiveXObject("ThunderAgent.Agent.1");
} catch (e) {
BigThunder.prototype._o = null;
}
}
return this._o;
},
_af: -1,
_afs:
[
//function (t, c, u, r, n, s) { t.AddTask5(u, "", "", n, r, -1, 0, -1, "", c, s, 1, "", -1) },
function (t, c, u, r, n, s) { t.AddTask5(u, n, "",n,r, -1, 0, -1, "", c, s, 1, "", -1) },
function (t, c, u, r, n, s) { t.AddTask4(u, "", "", n, r, -1, 0, -1, "", c, s) },
function (t, c, u, r, n, s) { t.AddTask3(u, "", "", n, r, -1, 0, -1, "", c) },
function (t, c, u, r, n, s) { t.AddTask2(u, "", "", n, r, -1, 0, -1, "") },
function (t, c, u, r, n, s) { t.AddTask (u, "", "", n, r, -1, 0, -1) }
],
_add:
function (cid, url, refer, name, stat)
{
if (this._af >= 0) {
this._afs[this._af](this._o, cid, url, refer, name, stat);
return true;
}
for (var i = 0; i < this._afs.length; ++i)
try {
this._afs[i](this._o, cid, url, refer, name, stat);
this._af = i;
return true;
} catch (e) {
}
return false;
},
_cf: -1,
_cfs:
[
function (t) { t.CommitTasks2(1); },
function (t) { t.CommitTasks(); }
],
_commit:
function ()
{
if (this._cf >= 0) {
this._cfs[this._cf](this._o);
return true;
}
for (var i = 0; i < this._cfs.length; ++i)
try {
this._cfs[i](this._o);
this._cf = i;
return true;
} catch (e) {
}
return false;
},
down:
function (cid, url, refer, name, stat)
{
if (!(this._add(cid, url, refer, name, stat) && this._commit()))
alert('不支持此方法,请安装最新的迅雷客户端');
},
batch:
function (res)
{
for (var i = 0; i < res.length; ++i) {
var o = res[i];
if (!this._add(o.cid, o.url, o.refer, o.name, o.stat))
return false;
}
return this._commit();
}
};
thunderAgent接口定义见这篇文章。http://topic.csdn.net/u/20080709/22/cec76078-7c9d-428a-bc9a-1f32454a77ae.html
我也想通过仿迅雷的方法调用外部的程序,但能力不够啊!