Jump to content



Photo

Get NetConnection status


  • Please log in to reply
17 replies to this topic

#1 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 26 October 2011 - 12:59 AM

Hi All,
To improve my knowledge i have written another basic example script. please help me and give me some suggestion on this to improve more..... The below script will check the connection status of the net..


Here is the UDF.
AutoIt         
  #include-once Local $strcomputer,$objWMIService,$colItems ,$objItem   Func Connection($strcomputer) $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2")    $colItems = $objWMIService.ExecQuery _     ("Select * from Win32_NetworkAdapter")   For $objItem in $colItems     Select Case $objItem.NetConnectionStatus         Case 0 $strStatus = "Disconnected"         Case 1 $strStatus = "Connecting"         Case 2 $strStatus = "Connected"         Case 3 $strStatus = "Disconnecting"         Case 4 $strStatus = "Hardware not present"         Case 5 $strStatus = "Hardware disabled"         Case 6 $strStatus = "Hardware malfunction"         Case 7 $strStatus = "Media disconnected"         Case 8 $strStatus = "Authenticating"         Case 9 $strStatus = "Authentication succeeded"         Case 10 $strStatus = "Authentication failed"         Case 11 $strStatus = "Invalid address"         Case 12 $strStatus = "Credentials required"     EndSelect  Next Return $strStatus EndFunc


Here is the example:
#include <Net.au3> MsgBox(0,"",Connection(@ComputerName))

Thank you,Regards,K.Syed Ibrahim.







#2 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 26 October 2011 - 02:49 AM

This line:
Local $strcomputer,$objWMIService,$colItems ,$objItem  

should be inside the function. Otherwise it will declare those variables as global and may cause interaction with other parts of a script if you reuse the variable names. Declaring a variable as Local in a Global scope declares them as global automatically, the Local designation is ignored in this case.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#3 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 26 October 2011 - 03:06 AM

Also your Select block is horribly broken. It's using Switch syntax, but incorrectly. Help file awaits!

Edited by wraithdu, 26 October 2011 - 03:06 AM.


#4 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 26 October 2011 - 03:17 AM

I also noticed that the value in $strstatus is only going to hold the last value of $colitems because you don't preserve any other readings. My computer shows several network connections, most disconnected, that were added because of VPN connections and other wireless locations I've connected it to.

Something like this might be more in line with what you're looking to show.

AutoIt         
Func Connection($strcomputer)     Local $strStatus=""     $objWMIService = ObjGet("winmgmts:\\" & $strcomputer & "\root\cimv2")     $colItems = $objWMIService.ExecQuery _             ("Select * from Win32_NetworkAdapter")     For $objItem In $colItems         Switch $objItem.NetConnectionStatus             Case 0                 $strStatus &= "Disconnected" & @LF             Case 1                 $strStatus &= "Connecting" & @LF             Case 2                 $strStatus &= "Connected" & @LF             Case 3                 $strStatus &= "Disconnecting" & @LF             Case 4                 $strStatus &= "Hardware not present" & @LF             Case 5                 $strStatus &= "Hardware disabled" & @LF             Case 6                 $strStatus &= "Hardware malfunction" & @LF             Case 7                 $strStatus &= "Media disconnected" & @LF             Case 8                 $strStatus &= "Authenticating" & @LF             Case 9                 $strStatus &= "Authentication succeeded" & @LF             Case 10                 $strStatus &= "Authentication failed" & @LF             Case 11                 $strStatus &= "Invalid address" & @LF             Case 12                 $strStatus &= "Credentials required" & @LF         EndSwitch     Next     Return $strStatus EndFunc   ;==>Connection

Edited by BrewManNH, 26 October 2011 - 03:19 AM.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#5 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 26 October 2011 - 05:31 AM

Thanks for all your response! I am glad to get suggestion and i have modified my scripts!


BrewManNH,

why i am getting result like attached screen shot? i am expecting the result should be either "Connected"or "disconnected" or "Hardware not found".But the result shows 7 times as disconnected and 1 time connected.

Edited:

i got it why it happened i moddifed the script again. But still i have a question. My machine is connected with network, but still shows as disconnected? i am wondering why :graduated:

Edited by Syed23, 26 October 2011 - 05:38 AM.

Thank you,Regards,K.Syed Ibrahim.

#6 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 26 October 2011 - 05:54 AM

is this correct am i doing?

AutoIt         
  Global $strcomputer, $objWMIService, $colItems, $objItem   Connection(@ComputerName)     Func Connection($strcomputer) Local $strStatus = "" $objWMIService = ObjGet("winmgmts:\\" & $strcomputer & "\root\cimv2")   $colItems = $objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapter where NetConnectionStatus='2'") $strStatus = "Disconnected" For $objItem In $colItems Switch $objItem.NetConnectionStatus Case 0 $strStatus = "Disconnected" Case 1 $strStatus = "Connecting" Case 2 $strStatus = "Connected" Case 3 $strStatus = "Disconnecting" Case 4 $strStatus = "Hardware not present" Case 5 $strStatus = "Hardware disabled" Case 6 $strStatus = "Hardware malfunction" Case 7 $strStatus = "Media disconnected" Case 8 $strStatus = "Authenticating" Case 9 $strStatus = "Authentication succeeded" Case 10 $strStatus = "Authentication failed" Case 11 $strStatus = "Invalid address" Case 12 $strStatus = "Credentials required" EndSwitch   Next MsgBox(0,"", $strStatus) EndFunc   ;==>Connection

Thank you,Regards,K.Syed Ibrahim.

#7 frp64

frp64

    Seeker

  • New Members
  • 4 posts

Posted 26 October 2011 - 10:38 AM

Hi, maybe in this page you can meet anything. The link is:

http://blogs.technet.com/b/heyscriptingguy/archive/2007/08/20/how-can-i-tell-if-a-wireless-network-adapter-is-connected-to-the-network.aspx

Greetings, Frank Rodriguez.

#8 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 26 October 2011 - 11:49 AM

Thanks for all your response! I am glad to get suggestion and i have modified my scripts!


BrewManNH,

why i am getting result like attached screen shot? i am expecting the result should be either "Connected"or "disconnected" or "Hardware not found".But the result shows 7 times as disconnected and 1 time connected.

Edited:

i got it why it happened i moddifed the script again. But still i have a question. My machine is connected with network, but still shows as disconnected? i am wondering why :D

You're showing as disconnected because you broke the functionality of the script again by "fixing" the script back to the way you had it before. You should reread what I wrote about the $strstatus value in my post and try and figure out what you're doing wrong, and where you really need to look to see if a specific NIC is connected or not, not whether all the network connections on your system are connected or not.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#9 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 26 October 2011 - 05:03 PM

Yeah! :D now i fixed it completely! Thanks :oops:
Thank you,Regards,K.Syed Ibrahim.

#10 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,871 posts

Posted 26 October 2011 - 06:21 PM

Yeah! :D now i fixed it completely! Thanks :oops:


So.....

This is an Example Script Forum, try to work out the protocol when you have improved a script.

Or was this a thinly veiled support question?
AutoIt Absolute Beginners Require a serial
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)

#11 guinness

guinness

    guinness

  • MVPs
  • 10,426 posts

Posted 26 October 2011 - 06:48 PM

This is an Example Script Forum, try to work out the protocol when you have improved a script.

Actually this brings up a valid question, if you've specified somewhere along the course of the conversation that you've fixed a problem with the initial code example (that you've freely posted without a license,) is it mandatory to update the original post? Or could this be construed as breaking the 'ask for source code' rules?

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#12 guinness

guinness

    guinness

  • MVPs
  • 10,426 posts

Posted 26 October 2011 - 07:29 PM

Here is a better approach >> the huge difference is this gets rid of the connections the average user isn't really concerned about, for example I'm only interested in the physical connections i.e. WLAN, Bluetooth & LAN. It also returns an Array and not a String as well as telling you what the adapters are!

Function:
AutoIt         
#include <Array.au3> Local $aArray = _AdapterConnections() ; Data is returned as a 2D Array. Adapter|Status. _ArrayDisplay($aArray) For $i = 1 To $aArray[0][0]     ConsoleWrite('Adapter: ' & $aArray[$i][0] & ' is currently ' & $aArray[$i][1] & '.' & @LF) Next Func _AdapterConnections($sComputer = @ComputerName)     Local $aReturn[1][2] = [[0, 2]], $iDimension = 0, $sDelimeter = Chr(01), $sReturn = ''     Local $aStatus[13] = ['Disconnected', 'Connecting', 'Connected', 'Disconnecting', 'Hardware not present', _             'Hardware disabled', 'Hardware malfunction', 'Media disconnected', 'Authenticating', 'Authentication succeeded', _             'Authentication failed', 'Invalid address', 'Credentials required']     Local $oWMIService = ObjGet('winmgmts:' & $sComputer & '')     Local $oColItems = $oWMIService.ExecQuery('Select * From Win32_NetworkAdapter', 'WQL', 0x30)     If IsObj($oColItems) Then         For $oObjItem In $oColItems             If $oObjItem.AdapterType = '' Or $oObjItem.NetConnectionID = '' Then ; Ensures that the connections are physical adapters.                 ContinueLoop             EndIf             If StringInStr($sDelimeter & $sReturn, $sDelimeter & $oObjItem.Description & $sDelimeter, 1) Then ; Ensures there are no duplicates.                 ContinueLoop             EndIf             $sReturn &= $oObjItem.Description & $sDelimeter             If ($aReturn[0][0] + 1) >= $iDimension Then ; <a href='http://www.autoitscript.com/forum/topic/129689-redim-the-most-efficient-way-so-far-when-you-have-to-resize-an-existing-array/' class='bbc_url' title=''>http://www.autoitscript.com/forum/topic/129689-redim-the-most-efficient-way-so-far-when-you-have-to-resize-an-existing-array/</a>                 $iDimension = ($aReturn[0][0] + 1) * 2                 ReDim $aReturn[$iDimension][$aReturn[0][1]]             EndIf             $aReturn[0][0] += 1             $aReturn[$aReturn[0][0]][0] = $oObjItem.Description             For $i = 0 To 12                 If $oObjItem.NetConnectionStatus = $i Then ; <a href='http://msdn.microsoft.com/en-us/library/windows/desktop/aa394216(v=vs.85' class='bbc_url' title='External link' rel='nofollow external'>http://msdn.microsoft.com/en-us/library/windows/desktop/aa394216(v=vs.85</a>).aspx                     $aReturn[$aReturn[0][0]][1] = $aStatus[$i]                     ExitLoop                 EndIf             Next         Next     EndIf     ReDim $aReturn[$aReturn[0][0] + 1][$aReturn[0][1]]     $aReturn[0][1] = ''     Return $aReturn EndFunc   ;==>_AdapterConnections

Edited by guinness, 08 October 2012 - 04:00 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#13 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,871 posts

Posted 27 October 2011 - 03:17 AM

What I meant was, the OP posted here in the Example Forum.

Then grins with glee after "fixing it completely" and disappears into the night, suggesting it was really just support they wanted in the first place, not to provide an example.
AutoIt Absolute Beginners Require a serial
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)

#14 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 27 October 2011 - 07:35 AM

i did not disappear John. Here is a public holiday and so i did not come to office and i did not get a chance to reply. Here is my fixed code. Thanks for the open comment :D

AutoIt         
  #include-once Global $strcomputer, $objWMIService, $colItems, $objItem   Func Connection($strcomputer) Local $strStatus = "" $objWMIService = ObjGet("winmgmts:\\" & $strcomputer & "\root\cimv2")   $colItems = $objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapter where NetConnectionStatus='2'") $strStatus = "Disconnected";    if connection is not there it won't go inside the loop and it will use this value For $objItem In $colItems Switch $objItem.NetConnectionStatus Case 0 $strStatus = "Disconnected" Case 1 $strStatus = "Connecting" Case 2 $strStatus = "Connected" Case 3 $strStatus = "Disconnecting" Case 4 $strStatus = "Hardware not present" Case 5 $strStatus = "Hardware disabled" Case 6 $strStatus = "Hardware malfunction" Case 7 $strStatus = "Media disconnected" Case 8 $strStatus = "Authenticating" Case 9 $strStatus = "Authentication succeeded" Case 10 $strStatus = "Authentication failed" Case 11 $strStatus = "Invalid address" Case 12 $strStatus = "Credentials required" EndSwitch   Next Return $strStatus EndFunc   ;==>Connection

Thank you,Regards,K.Syed Ibrahim.

#15 guinness

guinness

    guinness

  • MVPs
  • 10,426 posts

Posted 27 October 2011 - 01:28 PM

Syed23,

Your code works, but doesn't meet what I would call a basic standard of coding, here's why >>

1. You're requesting the return of active connections only, thus rendering the Switch...EndSwitch useless.
2. If only returns the last active connection it finds, strange considering I have Bluetooth and WLAN enabled. (See BrewManNH's post as to why.)
3. Using Global declaration in this example isn't required.

How I would do your previous Example:
AutoIt         
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <Array.au3>   Global $aArray   $aArray = _AdaptersConnected() ; Data is returned as a 1D Array. Adapter. _ArrayDisplay($aArray)   For $A = 1 To $aArray[0]     ConsoleWrite("Adapter: " & $aArray[$A] & " is currently Connected." & @LF) Next   Func _AdaptersConnected($sComputer = @ComputerName)     Local $aReturn[1] = [0], $iDimension = 0, $oColItems, $oWMIService, $sDelimeter = Chr(01), $sReturn = ""       $oWMIService = ObjGet("winmgmts:\\" & $sComputer & "\")     $oColItems = $oWMIService.ExecQuery("Select * From Win32_NetworkAdapter Where NetConnectionStatus='2'", "WQL", 0x30)       If IsObj($oColItems) Then         For $oObjItem In $oColItems             If $oObjItem.AdapterType = "" Or $oObjItem.NetConnectionID = "" Then ; Ensures that the connections are physical adapters.                 ContinueLoop             EndIf             If StringInStr($sDelimeter & $sReturn, $sDelimeter & $oObjItem.Description & $sDelimeter, 1) Then ; Ensures there are no duplicates.                 ContinueLoop             EndIf             $sReturn &= $oObjItem.Description & $sDelimeter               If ($aReturn[0] + 1) >= $iDimension Then ; <a href='http://www.autoitscript.com/forum/topic/...en-you-have-to-resize-an-exist' class='bbc_url' title=''>http://www.autoitscript.com/forum/topic/...en-you-have-to-resize-an-exist</a>                 $iDimension = ($aReturn[0] + 1) * 2                 ReDim $aReturn[$iDimension]             EndIf               $aReturn[0] += 1             $aReturn[$aReturn[0]] = $oObjItem.Description         Next     EndIf       ReDim $aReturn[$aReturn[0] + 1]     Return $aReturn EndFunc   ;==>_AdaptersConnected

Edited by guinness, 27 October 2011 - 01:40 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#16 Syed23

Syed23

    Mass Spammer! - It's Me

  • Active Members
  • PipPipPipPipPipPip
  • 519 posts

Posted 27 October 2011 - 05:59 PM

:D hmmm... ok i will use your example and i will compare myself what is the difference. Thanks for your suggestion guinness!
Thank you,Regards,K.Syed Ibrahim.

#17 guinness

guinness

    guinness

  • MVPs
  • 10,426 posts

Posted 27 October 2011 - 06:34 PM

Look at the ConsoleWrite() with your version I get 1 connected when I should get 2 and secondly what is connected? Mine shows the adapter names.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#18 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 27 October 2011 - 06:40 PM

I left my example as a way to "teach him to fish", obviously fishing isn't his forte.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users