Jump to content
Sign in to follow this  
oMBRa

currently connex

Recommended Posts

oMBRa

how to see what is the currently connex and the bytes sended and received?

Share this post


Link to post
Share on other sites
oMBRa

bump

Share this post


Link to post
Share on other sites
picaxe

A WMI example generated from ScriptOmatic (can be downloaded from the Examples forum) by SvenP

$objWMIService = ObjGet("winmgmts:\\.\root\cimv2")
$objClass = $objWMIService.ExecQuery("Select * from Win32_PerfRawData_Tcpip_NetworkInterface")

For $obj In $objClass
    msgbox(1,"","Interface: " & $obj.Name & @CRLF & _
                "Bytes Received/sec: " & $obj.BytesReceivedPerSec & @CRLF & _
                "Bytes Sent/sec: " & $obj.BytesSentPerSec & @CRLF & _
                "Bytes Total/sec: " & $obj.BytesTotalPerSec & @CRLF & _
                "Network rate: " & $obj.CurrentBandwidth)
Next

Share this post


Link to post
Share on other sites
oMBRa

doesnt work for me. No MsgBox are displayed

Share this post


Link to post
Share on other sites
dbzfanatic

Taken from XenoBiologist (hope I spelled that right)

$INTERNET_CONNECTION_MODEM = 0x1
$INTERNET_CONNECTION_LAN = 0x2
$INTERNET_CONNECTION_PROXY = 0x4
$INTERNET_CONNECTION_MODEM_BUSY = 0x8
$INTERNET_RAS_INSTALLED = 0x10
$INTERNET_CONNECTION_OFFLINE = 0x20
$INTERNET_CONNECTION_CONFIGURED = 0x40

$ret = DllCall("WinInet.dll", "int", "InternetGetConnectedState", "int_ptr", 0, "int", 0)

If $ret[0] Then
  ;check type of connection
    $sX = "Connected !" & @LF & "------------------" & @LF
    If BitAND($ret[1], $INTERNET_CONNECTION_MODEM) Then $sX &= "MODEM" & @LF
    If BitAND($ret[1], $INTERNET_CONNECTION_LAN) Then $sX &= "LAN" & @LF
    If BitAND($ret[1], $INTERNET_CONNECTION_PROXY) Then $sX &= "PROXY" & @LF
    If BitAND($ret[1], $INTERNET_CONNECTION_MODEM_BUSY) Then $sX &= "MODEM_BUSY" & @LF
    If BitAND($ret[1], $INTERNET_RAS_INSTALLED) Then $sX &= "RAS_INSTALLED" & @LF
    If BitAND($ret[1], $INTERNET_CONNECTION_OFFLINE) Then $sX &= "OFFLINE" & @LF
    If BitAND($ret[1], $INTERNET_CONNECTION_CONFIGURED) Then $sX &= "CONFIGURED" & @LF
Else
    $sX = "Not Connected"
EndIf

MsgBox(4096, $ret[0] & ":" & $ret[1], $sX)

Share this post


Link to post
Share on other sites
oMBRa

I have to know bytes sent and received not if Im connecteb... thoug thx

Share this post


Link to post
Share on other sites
dbzfanatic

That tells if you're connected and what's connected. You can probably use WMI to get the sent/recieved data. You should use that script as a base and work from there.

Share this post


Link to post
Share on other sites
oMBRa

I dont much know about Dll

Share this post


Link to post
Share on other sites
dbzfanatic

I dont much know about Dll

Neither do I but it's a great way to learn. Just look at the parameters on MSDN when you find the function you need (google is your friend) then use DllCall to use it.

Share this post


Link to post
Share on other sites
picaxe

WMI is preinstalled on all but WinNT4 and win95/98

Edited by picaxe

Share this post


Link to post
Share on other sites
oMBRa

Seems I cant found WMI parameters on MSDN ;)

Share this post


Link to post
Share on other sites
oMBRa

bump

Share this post


Link to post
Share on other sites
PsaltyDS

bump

You're getting kind of annoying, as you seem to have no effort into this at all.

Post the last code you tried and exactly what results you got.

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
oMBRa

Picaxe code's showed nothing,dbzfanatic's code says only if im connected... So I have no code and I cant found any parameter of WMI on msdn, with my last post I meant if anyone could give me any link

Share this post


Link to post
Share on other sites
PsaltyDS

Picaxe code's showed nothing,dbzfanatic's code says only if im connected... So I have no code and I cant found any parameter of WMI on msdn, with my last post I meant if anyone could give me any link

Google: +WMI +MSDN

Over 400K results...

;)

AutoIt forum search: WMI

Most recent 1000 results...

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×