grazie ragazzi,
io sono su aruba. di quale funzione dovrei chiedere?
il codice di random.inc è
togliendo la seconda riga "On Error Resume Next"codice:<% Function RandomImage(strPath,strDefault) On Error Resume Next Randomize Timer ' declare all variables Dim objFSO, objFolder, objFiles, objFile Dim strFiles, strImages, strPhysical, strFile ' this constant has the names of valid image file name ' extensions and can be modified for more image types Const strValid = ".gif.jpg.png" ' make sure we have a trailing slash in the path If Right(strPath,1) <> Chr(47) Then strPath = strPath & Chr(47) ' get the physical path of the folder strPhysical = Server.MapPath(strPath) ' get a File System Object Set objFSO = Server.CreateObject("Scripting.FileSystemObject") ' create a folder object Set objFolder = objFSO.GetFolder(strPhysical) ' get the files collection Set objFiles = objFolder.Files ' enumerate the files collection looking for images For Each objFile in objFiles strFile = LCase(objFile.Name) If Instr(strValid,Right(strFile,4)) Then ' add vaild images to a string of image names strFiles = strFiles & strFile & vbTab End If Next ' split the image names into an array strImages = Split(strFiles,vbTab) ' if we have an array... If UBound(strImages) > 1 Then ' get a random name RandomImage = strPath & strImages(Int(Rnd(1)*UBound(strImages))) Else ' otherwise return the default RandomImage = strDefault End If End Function %>
succede questo errore
la riga è quella che contiene Set objFolder = objFSO.GetFolder(strPhysical)codice:Microsoft VBScript runtime error '800a004c' Path not found RandomImage.inc, line 21
attendo, grazie ancora. daniele.

Rispondi quotando