【求助】vbs问题
vbs对话框点取消后出现数组越界flag=&h200
whichone=openfile("choose a file","c:\","Everything|*.*|Text Files|*.txt|Word-Documents|*.DOC",2,flag)
msgbox "raw data returned:"&whichone
whichone=split(whichone," ")
path=whichone(0)
filecount=ubound(whichone)
if filecount=0 then
msgbox "you selected one file:"&whichone(0)
msgbox "returned flag:"&flag
if(flag and 1) then
msgbox "readonly selected"
else
msgbox "readonly not selected"
end if
if(flag and 1024) then
msgbox "selected file is not txt file!"
else
msgbox "selected file is of default type!"
end if
else
msgbox "you selected "&filecount&" files!"
for x=1 to ubound(whichone)
list=list&path&whichone(x)&vbcr
next
msgbox list
end if
function openfile(title,dir,filter,index,flags)
set comdlg=createobject(")
comdlg.filter=filter
comdlg.filterindex=index
comdlg.flags=flags
comdlg.maxfilesize=260
comdlg.cancelerror=false
comdlg.dialogtitle=title
comdlg.initdir=dir
comdlg.defaultext="txt"
comdlg.showopen
openfile=comdlg.filename
flags=comdlg.flags
end function