黄
黄忠伟
Unregistered / Unconfirmed
GUEST, unregistred user!
下载软件flashget 在ie浏览器的右键集成了一个菜单“使用网际快车下载所有链接”,
我想通过写代码把我需要的下载地址传给 flashget 。
在flashget的路径中有一个jc_all.htm文件,内容是这样的:
<script language="VBScript">
'Great thanks to Vladimir Romanov(Author of ReGet Pro)
On Error Resume Next
set JetCarCatch=CreateObject("JetCar.Netscape")
if err<>0 then
MsgBox("FlashGet not properly installed!"+ vbCrLf+"Please Install FlashGet again")
else
set links = external.menuArguments.document.links
ReDim params(links.length*2)
params(0)=external.menuArguments.document.Url
for i = 0 to links.length-1
params(i*2+1)=links(i).href
params(i*2+2)=links(i).innerText
next
JetCarCatch.AddUrlList params
end if
</script>
它实际上就是调用了 "JetCar.Netscape" 对象的 AddUrlList 方法,
我用delphi写了如下代码:
procedure TForm1.Button1Click(Sender: TObject);
var
myObject:Variant;
paraStr,test:array[0..1] of string
//把 string 改成 Variant,出错原因还是一样
begin
myObject:=CreateOleObject('JetCar.Netscape');
paraStr[0]:= 'http://www.guilin.com.cn/caiwuke/room.exe';
paraStr[1]:='room';
myObject.AddUrlList(paraStr)
//这句代码出错
end;
结果语法检查时出错: Type not allowed in Variant Dispatch call
请问我应该怎么写?谢谢
我想通过写代码把我需要的下载地址传给 flashget 。
在flashget的路径中有一个jc_all.htm文件,内容是这样的:
<script language="VBScript">
'Great thanks to Vladimir Romanov(Author of ReGet Pro)
On Error Resume Next
set JetCarCatch=CreateObject("JetCar.Netscape")
if err<>0 then
MsgBox("FlashGet not properly installed!"+ vbCrLf+"Please Install FlashGet again")
else
set links = external.menuArguments.document.links
ReDim params(links.length*2)
params(0)=external.menuArguments.document.Url
for i = 0 to links.length-1
params(i*2+1)=links(i).href
params(i*2+2)=links(i).innerText
next
JetCarCatch.AddUrlList params
end if
</script>
它实际上就是调用了 "JetCar.Netscape" 对象的 AddUrlList 方法,
我用delphi写了如下代码:
procedure TForm1.Button1Click(Sender: TObject);
var
myObject:Variant;
paraStr,test:array[0..1] of string
//把 string 改成 Variant,出错原因还是一样
begin
myObject:=CreateOleObject('JetCar.Netscape');
paraStr[0]:= 'http://www.guilin.com.cn/caiwuke/room.exe';
paraStr[1]:='room';
myObject.AddUrlList(paraStr)
//这句代码出错
end;
结果语法检查时出错: Type not allowed in Variant Dispatch call
请问我应该怎么写?谢谢