sorry for my bad english
i have written a little desklet , who i can see the down and up stream , local ip and i-net IP
i see the text and now i would insert a graphic for down and up
who i can that , here the source code by main.vbs
und das ganze in meiner landessprache
hab ein desklet geschrieben in der die ip(local sowie extern) sowie download and upload geschwindigkeit angezeigt wird.
das ganze funktioniert , nun wollte ich das ganze noch grafisch darstellen.
wie muss ich das anstellen?
Dim wshNet
Dim IPConfigSet
Dim IP
Dim LanIP
Dim objWMI
Dim colClass
Dim objClass
DIM I
Dim NetzWname
Dim LastSend , LastRec
Dim CurSend,CurRec
Dim strComputer
strComputer = "."
LastRec = -1
LastSend = -1
set objwmi = GetObject("winmgmts:" & strComputer & "rootcimv2")
Set WshNet = CreateObject ("Wscript.Network")
SQL="Select BytesReceivedPersec,BytesSentPersec from Win32_PerfRawData_Tcpip_NetworkInterface"'
'call netz()
function IPA()
set IPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
("SELECT IPAddress, DefaultIPGateway, IPSubnet FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=TRUE")
for each IPConfig in IPConfigSet
if Not IsNull(IPConfig.IPAddress) then
for i = LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
IP = IPConfig.IPAddress(i)
next
end if
set LanIP = this.Layers("LanIP")
LanIP.Text = IP
next
end function
function netzwerkarte()
set colItems = objwmi.ExecQuery("SELECT * FROM Win32_NetWorkAdapterConfiguration")
for each objitem in colItems
if objitem.IPEnabled then
netzwname = objitem.description
WScript.Echo netzwname
netzwerkarte = netzwname
exit for
end if
next
end function
sub Netz()
'netzwname = netzwerkarte()
netzwname ="Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Adapter, Copper RJ-45"
sql = sql & " WHERE Name = '"& netzwname &"'"
'Set objWMI = GetObject("winmgmts:" & strComputer & "rootcimv2")
Set colClass = objWMI.ExecQuery("Select * from Win32_PerfRawData_Tcpip_NetworkInterface",,48)
'Set colClass = objWMI.ExecQuery(sql,,48)
'WScript.Echo sql
CurSend = 0
CurRec = 0
For Each objClass in colClass
'wscript.echo objclass.name
'WScript.Echo "BytesReceivedPersec: " & objClass.BytesReceivedPersec
'WScript.Echo "BytesSentPersec: " & objClass.BytesSentPersec
CurRec = curRec + objClass.BytesReceivedPersec
CurSend = CurSend + objClass.BytesSentPersec
Next
If LastRec <> 0 then
rval=(CurRec - LastRec)*1000/1000
revalRec = FormatNumber(rval/1024 ,2) & " kb/s"
'WScript.Echo revalrec
set LR = this.Layers("LR")
LR.Text = revalRec
end if
LastRec = CurRec
If LastSend <> 0 then
rval=(CurSend - LastSend)*1000/1000
revalSend = FormatNumber(rval/1024 ,2) & " kb/s"
'WScript.Echo revalrec
set LS = this.Layers("LS")
LS.Text = revalSend
end if
LastSend = CurSend
End sub
thx for help!
Aqua-Soft Forums
