ASP能将对象的属性设置成变量吗?
Function GetFileList(folderName)
Dim G_F_Fso,ObjFolder,ObjFile,EachFile
Dim folder_Name
folder_Name = Server.MapPath(folderName)
' If folder_Name = " " Then
' CustomMsg "必须为方法指定参数 "
' Response.End()
' End If
If Err <> 0 Then
RunTimeErrorMsg
End If
Set G_F_Fso = Server.CreateObject(FSO)
Set ObjFolder = G_F_Fso.GetFolder(folder_Name)
Set ObjFile = ObjFolder.Files
For Each EachFile in ObjFile
Response.Write EachFile.Type & " <br> " '这里每次只能取一个属性.能不能在这里用个变量.应该怎么实现.谢谢
Next
Set ObjFile = Nothing
Set ObjFolder = Nothing
Set G_F_Fso = Nothing
End Function
GetFileList( ". ")
------解决方案--------------------脚本的动态执行啊,
js中使用eval语句
vbs中使用execute语句
可以将一个字符串作为代码执行
比如:(VBS)
execute( "EachFile. " & 你的变量 )