主题:[讨论]delphi中调用vbscript脚本语言,急!!在线等待
各位仁兄,帮忙看看:
l_ScriptControl:=TScriptControl.Create(nil); //创建Script控制对象
l_ScriptControl.AllowUI:=True;
l_ScriptControl.Language:='VBScript'; //确定Script语言
v := VarArrayCreate([0, 0], varVariant);
v[0] := InputVarArrays;
Params: = PSafeArray(TVarData(v).VArray);
l_scriptCode:=Tstringlist.Create;
try
l_scriptCode.LoadFromFile(VBScript_filename+'.vbs'); //导入VBS文件程序
if l_scriptCode.Count=0 then exit;
l_ScriptControl.AddCode(l_scriptCode.Text);
result:=l_ScriptControl.Run(VBScript_filename, Params); //运行VBS程序
finally
l_ScriptControl.Free; //最后释放所有的VBS对象
l_scriptCode.Free;
end;
大大家帮忙看看,下面这三句是什么意思,该怎么理解呀
v := VarArrayCreate([0, 0], varVariant);
v[0] := InputVarArrays;
Params: = PSafeArray(TVarData(v).VArray);
l_ScriptControl:=TScriptControl.Create(nil); //创建Script控制对象
l_ScriptControl.AllowUI:=True;
l_ScriptControl.Language:='VBScript'; //确定Script语言
v := VarArrayCreate([0, 0], varVariant);
v[0] := InputVarArrays;
Params: = PSafeArray(TVarData(v).VArray);
l_scriptCode:=Tstringlist.Create;
try
l_scriptCode.LoadFromFile(VBScript_filename+'.vbs'); //导入VBS文件程序
if l_scriptCode.Count=0 then exit;
l_ScriptControl.AddCode(l_scriptCode.Text);
result:=l_ScriptControl.Run(VBScript_filename, Params); //运行VBS程序
finally
l_ScriptControl.Free; //最后释放所有的VBS对象
l_scriptCode.Free;
end;
大大家帮忙看看,下面这三句是什么意思,该怎么理解呀
v := VarArrayCreate([0, 0], varVariant);
v[0] := InputVarArrays;
Params: = PSafeArray(TVarData(v).VArray);