StungStang Posted August 8, 2011 Posted August 8, 2011 Hi to all, i want to add to my script a "connection detector". For example see this photo:How you can see, there are two connection setting on pc...there are a metod to detect that with autoit. I need that becouse i want create a "pppoe connection creator", for switch the ip faster =)Hi!
wakillon Posted August 9, 2011 Posted August 9, 2011 Try this #include <Array.au3> $avNetworkConnections = _GetNetworkConnections ( ) _ArrayDisplay ( $avNetworkConnections ) Func _GetNetworkConnections ( ) Local Const $NETWORK_CONNECTIONS = 49 Local $objShell = ObjCreate ( "Shell.Application" ) Local $objFolder = $objShell.Namespace ( $NETWORK_CONNECTIONS ) Local $objFolderItem = $objFolder.Self Local $aRetArr[2] = [1, $objFolderItem.Path] Local $ColItems = $objFolder.Items Local $iUbound = 0 For $objItem In $ColItems $iUbound = UBound ( $aRetArr ) ReDim $aRetArr[$iUbound+1] $aRetArr[$iUbound] = $objItem.Name Next $aRetArr[0] =$iUbound Return $aRetArr EndFunc ;==> _GetNetworkConnections ( ) AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
StungStang Posted August 9, 2011 Author Posted August 9, 2011 Thanks that seems to work...now another question =P. There is a way to know if one of these detect connection, is an pppoe connection?...
wakillon Posted August 9, 2011 Posted August 9, 2011 Thanks that seems to work...now another question =P. There is a way to know if one of these detect connection, is an pppoe connection?... #include <Constants.au3> ConsoleWrite ( "_IpConfigAll : " & _IpConfigAll ( ) & @Crlf ) Func _IpConfigAll ( ) Local $_Pid, $_StdoutRead = "" $_Pid = Run ( "ipconfig /all", @SystemDir, @SW_HIDE, $STDOUT_CHILD ) While ProcessExists ( $_Pid ) $_StdoutRead &= StdoutRead ( $_Pid ) Wend Return StringStripWS ( $_StdoutRead, 7 ) EndFunc ;==> _IpConfigAll ( ) AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
StungStang Posted August 9, 2011 Author Posted August 9, 2011 #include <Constants.au3> ConsoleWrite ( "_IpConfigAll : " & _IpConfigAll ( ) & @Crlf ) Func _IpConfigAll ( ) Local $_Pid, $_StdoutRead = "" $_Pid = Run ( "ipconfig /all", @SystemDir, @SW_HIDE, $STDOUT_CHILD ) While ProcessExists ( $_Pid ) $_StdoutRead &= StdoutRead ( $_Pid ) Wend Return StringStripWS ( $_StdoutRead, 7 ) EndFunc ;==> _IpConfigAll ( ) Thanks for the code, but this script tell me if the current connection is set on pppoe mode. But i would to know if in all connection, detect by programm (active connection or not)..., there are a pppoe connection. Like as a pppo detector for action or not detection. But thanks for your hard help =)
wakillon Posted August 10, 2011 Posted August 10, 2011 Thanks for the code, but this script tell me if the current connection is set on pppoe mode. But i would to know if in all connection, detect by programm (active connection or not)..., there are a pppoe connection. Like as a pppo detector for action or not detection.But thanks for your hard help =)Sorry, any ideas ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
StungStang Posted August 10, 2011 Author Posted August 10, 2011 No problem, i have do too much for me ...if anyone know please tell me a soluction =)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now