Tioneb
-
10 nov. 2001 à 18:36
nouia_a7
Messages postés3Date d'inscriptionmardi 7 septembre 2004StatutMembreDernière intervention11 septembre 2004
-
11 sept. 2004 à 02:23
SI qq1 sait comment exécuter un vbs à partir d'une page web. le vbs serait sur le web également (dans le même site!). Donnez moi la source à intégrer dans la page htlm. Si vous savez aussi ce qu'on peut faire avec un vbs, dites le moi et aussi si on peut par exemple demander le prénom du visiteur à partir du vbs et de l'intégrer dans la page web.
Toutes les infos sur le sujet sont les bienvenue.
@+ et merci
Tioneb
Public Property Let FolderPath(strFolderPath)
mstrFolderPath = strFolderPath
End Property
Public Property Get FolderPath
FolderPath = mstrFolderPath
End Property
Public Property Set FSO(objFSO)
If objFSO Is Nothing Then
Err.Raise 32000, "FolderSummary", _
"The objFSO parameter of the FileSystemObject class " & _
"may not be Nothing."
End If
If TypeName(objFSO) <> "FileSystemObject" Then
Err.Raise 32000, "FolderSummary", _
"The objFSO parameter of the FileSystemObject class " & _
"may not be Nothing."
End If
Set mobjFSO = objFSO
End Property
Public Property Get FileCount
FileCount = mlngFileCount
End Property
Public Property Get SubFolderCount
SubFolderCount = mlngSubFolderCount
End Property
Public Property Get HasHiddenFiles
HasHiddenFiles = mboolHasHiddenFiles
End Property
Public Property Get OldestFileDate
OldestFileDate = mdatOldestFile
End Property
Public Property Get NewestFileDate
NewestFileDate = mdatNewestFile
End Property
Public Sub Summarize
Const ERR_INVALID_PATH = 76
Const ATTR_HIDDEN = 2
Dim objFolder
Dim objFiles
Dim objFileLoop
If mobjFSO Is Nothing Then
Err.Raise 32001, "FolderSummary.Summarize", _
"You cannot call the Summarize method without first " & _
"setting the FSO property to a valid FileSystemObject."
End If
If Len(Trim(mstrFolderPath)) = 0 Then
Err.Raise 32002, "FolderSummary.Summarize", _
"You cannot call the Summarize method without first " & _
"setting the FolderPath property to a valid path."
End If
On Error Resume Next
Set objFolder = mobjFSO.GetFolder(mstrFolderPath)
If Err.Number = ERR_INVALID_PATH Then
Err.Raise 32003, "FolderSummary.Summarize", _
"The '" & mstrFolderPath & "' path does not appear to be " & _
"valid. The Summarize method failed."
ElseIf Err.Number <> 0 Then
Err.Raise 32004, "FolderSummary.Summarize", _
"There was an error accessing the folder '" & mstrFolderPath & _
"': " & Err.Number & " - " & Err.Description & vbNewLine & _
vbNewLine & "The Summarize method failed."
Else
On Error GoTo 0
End If
'Now that we know that all is well with the Folder, let's summarize.
'First get the file and subfolders counts
mlngFileCount = objFolder.Files.Count
mlngSubFolderCount = objFolder.SubFolders.Count
'Next process the files
Set objFiles = objFolder.Files
For Each objFileLoop In objFiles
With objFileLoop
If .DateCreated < mdatOldestFile Then
mdatOldestFile = .DateCreated
End If
If .DateCreated > mdatNewestFile Then
mdatNewestFile = .DateCreated
End If
If .Attributes And ATTR_HIDDEN Then
mboolHasHiddenFiles = True
End If
End With
Next
Set objFileLoop = Nothing
Set objFiles = Nothing
Set objFolder = Nothing