W
wk0
Unregistered / Unconfirmed
GUEST, unregistred user!
<SCRIPT LANGUAGE="VBSCRIPT" RUNAT="SERVER">
Function LoadSubFolder()
set obj_fso=server.createobject("scripting.filesystemobject")
's_folderpath=uploadpath &
ParentFolder
s_folderpath="D:/homepage1/deptdoc/qd_website_file"
if obj_fso.folderexists(s_folderpath) then
set obj_folder=obj_fso.getfolder(s_folderpath)
dim vbarray(50)
i=0
for each thing in obj_folder.subfolders
vbarray(i)=thing.name
i=i+1
next
end if
LoadSubFolder=vbarray
End Function
</SCRIPT>
<script language="javascript">
function ExpandFolder(sel_source)
{
if (sel_source.options[0].text=="无") //源:只有“无”项目
return;
//移除原有数据
while ((k=sel_source.length-1)>=0)
{
if (sel_source.options[0].text=="无") //源:只有“无”项目
break;
sel_source.options.remove(k);
if (sel_source.options.length==0) //源:如果删除完所有有用项目,则添加提示项目:“无”
sel_source.options.add(new Option("无"));
}
//从目录读入数据
var myJSArray
myJSArray= LoadSubFolder()
//首先拷贝所有项目到目标:
var sel_source_len = myJSArray.length;
for (var j=0;
j<sel_source_len;
j++)
{
var SelectedText = myJSArray[j];
sel_source.options.add(new Option(SelectedText));
}
}
</script>
以上javascript代码怎样调用 VBS 中 Function LoadSubFolder()函数
Function LoadSubFolder()
set obj_fso=server.createobject("scripting.filesystemobject")
's_folderpath=uploadpath &
ParentFolder
s_folderpath="D:/homepage1/deptdoc/qd_website_file"
if obj_fso.folderexists(s_folderpath) then
set obj_folder=obj_fso.getfolder(s_folderpath)
dim vbarray(50)
i=0
for each thing in obj_folder.subfolders
vbarray(i)=thing.name
i=i+1
next
end if
LoadSubFolder=vbarray
End Function
</SCRIPT>
<script language="javascript">
function ExpandFolder(sel_source)
{
if (sel_source.options[0].text=="无") //源:只有“无”项目
return;
//移除原有数据
while ((k=sel_source.length-1)>=0)
{
if (sel_source.options[0].text=="无") //源:只有“无”项目
break;
sel_source.options.remove(k);
if (sel_source.options.length==0) //源:如果删除完所有有用项目,则添加提示项目:“无”
sel_source.options.add(new Option("无"));
}
//从目录读入数据
var myJSArray
myJSArray= LoadSubFolder()
//首先拷贝所有项目到目标:
var sel_source_len = myJSArray.length;
for (var j=0;
j<sel_source_len;
j++)
{
var SelectedText = myJSArray[j];
sel_source.options.add(new Option(SelectedText));
}
}
</script>
以上javascript代码怎样调用 VBS 中 Function LoadSubFolder()函数