Jump to content

currently connex


oMBRa
 Share

Recommended Posts

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

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...