Salut à tous
Encorrreeeee une question 
Voila avec mon script je récupère des infos que je souhaiterais afficher dans une iframe (j'ai essayé avec InnerHTLM mais je n'ai pas réussi avec la mise en forme
Voila le code :pour la récupération des infos :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| Sub DisplaySysInfo()
Dim tdComputer
Dim tdUser
Dim tdDomain
Dim tdIPAddress
Dim tdMACAddress
Dim clsSystemConfig
Set clsSystemConfig = New SystemConfigurations
Call GetSysInfo(clsSystemConfig)
Call GetIPAndMAC(clsSystemConfig)
With clsSystemConfig
tdComputer. = .ComputerName
tdUser = .LoggedUser
tdDomain = .Domain
tdIpAddress = .IPAddress
tdMACAddress = .MACAddress
End With
End Sub
'*****************************************************************************
Function GetIPAndMAC(clsSysConfig)
Dim colNIC
Dim objNIC
Dim strQuery, strIP
strQuery = "SELECT IPAddress, MACAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'True'"
Set colNIC = objWMI.ExecQuery(strQuery)
For Each objNIC in colNIC
For Each strIP in objNIC.IPAddress
If strIP <> "" Then
clsSysConfig.IPAddress = strIP
clsSysConfig.MACAddress = objNIC.MACAddress
End If
Next
Next
End Function
'*****************************************************************************
Function GetSysInfo(clsSysConfig)
Dim strQuery, strUser
Dim colSysInfo
strQuery = "SELECT Domain, Name, UserName FROM Win32_ComputerSystem"
Set colSysInfo = objWMI.ExecQuery(strQuery)
Dim objItem
For Each objItem in colSysInfo
With clsSysConfig
.ComputerName = UCase(objItem.Name)
.Domain = UCase(objItem.Domain)
strUser = UCase(objItem.UserName)
End With
Next
clsSysConfig.LoggedUser = Right(strUser, Len(strUser) - InStrRev(strUser, "\"))
End Function
'*****************************************************************************
Class SystemConfigurations
Public ComputerName
Public LoggedUser
Public Domain
Public IPAddress
Public MACAddress
End Class |
Voici celui pour l'affichage :
<iframe src="Call DisplaySysInfo()" color ="black" height="250px" width="400px" align="right"></iframe>
Malheureusement rien ne s'affiche dans mon iframe
Au cas ou je vous mets le code pour modifier et utiliser InnerHTML (perso j'ai pas réussi à l'aligner avec la premiere iframe:
La balise Body :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
| <BODY text=white bgcolor=DarkOrange TOPMARGIN="1" LEFTMARGIN="1">
<br>
<iframe src="log.txt" height="350px" width="400px" align="right"></iframe>
<center>
<b> Saisir votre code </b>
<INPUT Type="text" id="CP" name="CP" cp.value=" & cp.value & " size=4 maxlength=4 style="Color:red">
<INPUT Type="button" id="OK" name="OK" value="MAJ du Script" > <Input Type="checkbox" id ="OKOK" disabled="disabled" >
<br>
<fieldset><legend>Services</legend>
<fieldset Name="CartoucheAide" id="CartoucheAide" style="position:absolute; left:2px; height:15px; width:24px; background-color:#52B3F7">
<Div> -?- </Div>
<Div Name="DivAide" id="DivAide" style=" display:none">
Check services : Vérifie le statut des services<br>
Stop et kill services : Arrête et désactive les services<br>
Start et run services : Active et démarre les services <br>
Stop et kill iMQ : Arrête et désactive le service <br>
Start et run iMQ : Active et démarre le service <br>
Start : Active et démarre le service<br>
Gestion des services : Exécute la console de gestion des services<br>
</Div>
</fieldset>
<button onclick="Call Check_Services()">Check Services</button><br>
<button onclick="Call Stop_Services()">Stop et Kill Services</button><br>
<button onclick="Call Start_Services()">Start et Run Services</button><br>
<button onclick="Call Stop_()">Stop et kill </button><br>
<button onclick="Call Start_()">Start et run </button><br>
<button onclick="Call Start_()">Start service</button><br>
<button onclick="Run(1)">Gestion services</button>
</fieldset>
<br>
<fieldset><legend>Tache planifiee</legend>
<fieldset Name="CartoucheAide2" id="CartoucheAide2" style="position:absolute; left:2px; height:15px; width:24px; background-color:#52B3F7">
<Div> -?- </Div>
<Div Name="DivAide2" id="DivAide2" style=" display:none">
Gestion des tâches :
Check tâche : Vérifie le statut de la tâche <br>
Stop tâche : Désactive la tâche <br>
Start tâche : Active la tâche <br>
Run tâche : Exécute la tâche <br>
Planificateur des tâches : Exécute le Planificateur des tâches<br>
</Div>
</fieldset>
<button onclick="Call Tache_Check()">Check Tache</button><br>
<button onclick="Call Tache_OFF()">Tache OFF</button><br>
<button onclick="Call Tache_ON()">Tache ON</button><br>
<button onclick="Call Tache_RUN()">Run Tache</button><br>
<button onclick="Run(2)">Planificateur de Taches</button><br>
</fieldset>
<br>
<iframe src="Call DisplaySysInfo()" color ="black" height="250px" width="400px" align="right"></iframe>
<fieldset><legend>Gestion données</legend>
<fieldset Name="CartoucheAide3" id="CartoucheAide3" style="position:absolute; left:2px; height:15px; width:24px; background-color:#52B3F7">
<Div> -?- </Div>
<Div Name="DivAide3" id="DivAide3" style=" display:none">
Creation dossier migration : Crée dans c:\temp le dossier migration_H****, y depose la BDD <br>
Copie fichiers : Copie dans c:\temp\migration_H**** les fichiers <br>
Copie sur clé USB : Copie le dossier c:\temp\migration_H**** de ancien HDD sur clé USB<br>
Copie sur HDD : Copie le dossier D:\temp\migration_H**** de clé USB sur nouveau HDD<br>
Restauration données : Restaure la BDD , sur le nouveau HDD<br>
toto : Enlève la lecture seule sur le fichier <br>
Poste de travail : Execute le Poste de travail<br>
</Div>
</fieldset>
<button onclick="Call Copie_Temp()">Creation dossier migration</button><br>
<button onclick="Call Copie_Axis()">Copie fichiers <br></button><br>
<button onclick="Call Copie_USB()">Copie sur cle USB<br></button><br>
<button onclick="Call Copie_HDD()">Copie sur HDD<br></button><br>
<button onclick="Call Resto_Fichiers()">Restauration donnees</button><br>
<button onclick="Call User_Params()">toto<br></button><br>
<button onclick="Run(3)">Poste de travail</button><br>
</fieldset>
<br>
<fieldset><legend>Outils</legend>
<fieldset Name="CartoucheAide4" id="CartoucheAide4" style="position:absolute; left:2px; height:15px; width:24px; background-color:#52B3F7">
<Div> -?- </Div>
<Div Name="DivAide4" id="DivAide4" style=" display:none">
Panneau de config : Exécute le panneau de configurationbr>
Retrait KB2698365 : Désinstalle la KB2698365 (si vous avez une erreur c que celle-ci est pas présente)</br>
</Div>
</fieldset>
<button onclick="Call KB_Del()">Retrait KB2698365</button><br>
<button onclick="Run(4)">Panneau de config</button><br>
</fieldset>
<br>
</center>
</body> |
Et la commande :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| Sub DisplaySysInfo()
Dim tdComputer
Dim tdUser
Dim tdDomain
Dim tdIPAddress
Dim tdMACAddress
Dim clsSystemConfig
Set clsSystemConfig = New SystemConfigurations
Call GetSysInfo(clsSystemConfig)
Call GetIPAndMAC(clsSystemConfig)
With clsSystemConfig
tdComputer.InnerHTML = .ComputerName
tdUser.InnerHTML = .LoggedUser
tdDomain.InnerHTML = .Domain
tdIpAddress.InnerHTML = .IPAddress
tdMACAddress.InnerHTML = .MACAddress
End With
End Sub
'*****************************************************************************
Function GetIPAndMAC(clsSysConfig)
Dim colNIC
Dim objNIC
Dim strQuery, strIP
strQuery = "SELECT IPAddress, MACAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'True'"
Set colNIC = objWMI.ExecQuery(strQuery)
For Each objNIC in colNIC
For Each strIP in objNIC.IPAddress
If strIP <> "" Then
clsSysConfig.IPAddress = strIP
clsSysConfig.MACAddress = objNIC.MACAddress
End If
Next
Next
End Function
'*****************************************************************************
Function GetSysInfo(clsSysConfig)
Dim strQuery, strUser
Dim colSysInfo
strQuery = "SELECT Domain, Name, UserName FROM Win32_ComputerSystem"
Set colSysInfo = objWMI.ExecQuery(strQuery)
Dim objItem
For Each objItem in colSysInfo
With clsSysConfig
.ComputerName = UCase(objItem.Name)
.Domain = UCase(objItem.Domain)
strUser = UCase(objItem.UserName)
End With
Next
clsSysConfig.LoggedUser = Right(strUser, Len(strUser) - InStrRev(strUser, "\"))
End Function
'*****************************************************************************
Class SystemConfigurations
Public ComputerName
Public LoggedUser
Public Domain
Public IPAddress
Public MACAddress
End Class |
Alors j'aimerais que ce soit aligné en bas a droite avec la premiere iframe
Merci à tous pour votre aide tres précieuse et appreciée !
Partager