VBSript dans ue page web, comment faire?

Signaler
-
nouia_a7
Messages postés
3
Date d'inscription
mardi 7 septembre 2004
Statut
Membre
Dernière intervention
11 septembre 2004
-
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

3 réponses

Messages postés
22
Date d'inscription
dimanche 4 avril 2004
Statut
Membre
Dernière intervention
27 juin 2007

Pour mettre un vbs dans une page web ta qu'a mettre
ça dans ta page.

<script language="vbscript">
'Ici tu met ton script vbs
</SCRIPT>
Messages postés
3
Date d'inscription
mardi 7 septembre 2004
Statut
Membre
Dernière intervention
11 septembre 2004

<script language="vbscript">
Option Explicit

Dim objFSO
Dim objFoldSumm
Dim strSummary
dim path

path = inputbox("ecrire le trajet de repertoire que vous vouler la spyer :)")

Set objFoldSumm = New FolderSummary
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set objFoldSumm.FSO = objFSO
Set objFSO = Nothing

With objFoldSumm
.FolderPath = path
.Summarize

strSummary = "Summary for " & .FolderPath & ":" & vbNewLine & vbNewLine
strSummary = strSummary & "Number of Files: " & .FileCount & vbNewLine
strSummary = strSummary & "Number of SubFolders: " & _
.SubFolderCount & vbNewLine
strSummary = strSummary & "Has Hidden Files: " & .HasHiddenFiles & _
vbNewLine
strSummary = strSummary & "Oldest File Date: " & .OldestFileDate & _
vbNewLine
strSummary = strSummary & "Newest File Date: " & .NewestFileDate & _
vbNewLine
End With
Set objFoldSumm = Nothing

MsgBox strSummary

Class FolderSummary

'Private property variables
Private mstrFolderPath
Private mobjFSO
Private mlngFileCount
Private mlngSubFolderCount
Private mboolHasHiddenFiles
Private mdatOldestFile
Private mdatNewestFile

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.

'Initialize the stats
mlngFileCount = 0
mlngSubFolderCount = 0
mboolHasHiddenFiles = False
mdatOldestFile = #12/31/2999#
mdatNewestFile = #01/01/1900#

'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

End Sub

End Class
</SCRIPT>
Messages postés
3
Date d'inscription
mardi 7 septembre 2004
Statut
Membre
Dernière intervention
11 septembre 2004

voila mon script ;)