Bonjour à tous,
J'ai développé un petit script VBA qui m'affiche la vitesse de connexion maximum théorique de la carte réseau local d'un ordinateur. Il me donne également la référence de la carte réseau de ce dernier.
J'aurais voulu transposer cela côté web et j'ai pensé au JAVA. Est-ce que quelqu'un sait si c'est possible ?
Pour info, voici le script et son résultat en pièce jointe :
Merci d'avance et bonne journée !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 strComputer = "." Dim objWMIService: Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Dim colItems1: Set colItems1 = objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionStatus=2") Dim ObjWMI: Set ObjWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Dim colItems: Set colItems = ObjWMI.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") Dim adapterCFG For Each objItem in colItems1 strMACAddress = objItem.MACAddress If objItem.Speed >= 1000000000 Then strSpeedG = objItem.Speed / 1000000000 valSpeedG = " Gb/s" Else strSpeedM = objItem.Speed / 1000000 valSpeedM = " Mb/s" End If Next Set colNetCard = objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'True'") For Each objNetCard in colNetCard If objNetCard.MACAddress = strMACAddress Then For Each strIPAddress in objNetCard.IPAddress If InStr(strIPAddress,".") Then For each adapterCFG in colitems If strSpeedG >= 1 Then wscript.echo "Votre ordinateur permet une vitesse maximale de " & strSpeedG & valSpeedG & VBCRLF & "Votre carte carte reseau : " & adapterCFG.Caption Else wscript.echo "Votre ordinateur permet une vitesse maximale de " & strSpeedM & valSpeedM & VBCRLF & "Votre carte carte reseau : " & adapterCFG.Caption Next End If Next End If Next
Partager