#Include <GuiListView.au3>
#Include<Winapi.au3>
Local $xiaozhan ,$xiaoxiao, $count ,$aList, $x
;*****************************************************************************************
ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLL ncpa.cpl")
Sleep(800)
Dim $h=MsgBox(1, "请注意", "必须把本地连接的名字改成'本地连接'")
if $h<>1 Then
Exit 0
EndIf
;*****************************************************************************************
;*****************************************************************************************
WinWait("网络连接")
ControlClick("网络连接","FolderView","[ID:1]","left",2,45,58)
;*****************************************************************************************
;WinWait("网络连接")
;$xiaozhan = ControlGetHandle ( "网络连接", "", "[ID:1]") ;获取指定控件的内部句柄.
;MsgBox(4096, "测试",$xiaozhan)
;$xiaoxiao = _GUICtrlListView_GetISearchString($xiaozhan) ;获取控件的增字搜索字符串
;$count = _GUICtrlListView_GetItemCount($xiaozhan) ;获取列表视图控件的项目数
;$aList = _GUICtrlListView_GetItemText($xiaozhan,0) ;获取项目或子项目的文本
;MsgBox(4160, "Information", "Item Count: " & _GUICtrlListView_GetItemCount($xiaozhan))
;For $x = 0 To $count-1
;$aList = _GUICtrlListView_GetItemText($xiaozhan,$x) ;获取项目或子项目的文本
;if $aList = "本地连接" Then
;_GUICtrlListView_ClickItem( $xiaozhan, $x ,"left","",3) ;点击一个项目
;ConsoleWrite( $aList & @CRLF ) ;写入数据到 STDOUT 流.一些文本编辑器可以读取这个流作为其它程序可接受的数据.
;EndIf
;Next
;*****************************************************************************************
WinWait("本地连接 状态")
ControlClick("本地连接 状态","属性(&P)","[ID:1026]","left",2)
WinWait("本地连接 属性")
$xiaozhan = ControlGetHandle ( "本地连接 属性", "", "[ID:16012]") ;获取指定控件的内部句柄.
;MsgBox(4096, "测试",$xiaozhan)
$xiaoxiao = _GUICtrlListView_GetISearchString($xiaozhan) ;获取控件的增字搜索字符串
$count = _GUICtrlListView_GetItemCount($xiaozhan) ;获取列表视图控件的项目数
$aList = _GUICtrlListView_GetItemText($xiaozhan,0) ;获取项目或子项目的文本
;MsgBox(4160, "Information", "Item Count: " & _GUICtrlListView_GetItemCount($xiaozhan))
For $x = 0 To $count-1
$aList = _GUICtrlListView_GetItemText($xiaozhan,$x) ;获取项目或子项目的文本
if $aList = "Internet 协议 (TCP/IP)" Then
_GUICtrlListView_ClickItem( $xiaozhan, $x ,"left","",3) ;点击一个项目
ConsoleWrite( $aList & @CRLF ) ;写入数据到 STDOUT 流.一些文本编辑器可以读取这个流作为其它程序可接受的数据.
EndIf
Next
;*****************************************************************************************
ControlClick("Internet 协议 (TCP/IP) 属性","高级(&V)...","[ID:1015]");,"left",2)
ControlClick("高级 TCP/IP 设置","添加(&A)...","[ID:1017]")
MsgBox(4096,"请查看ini文件","ini文件里面的IP是不是板子的IP是的点击确定不是的修改后在点击确定")
$title=IniRead("本地连接添加(删除)附加IP.ini","title","title","")
MsgBox(4096,"确认ini文件IP",$title)
;*****************************************************************************************
;[title]
;title=192.168.10.113"{TAB}"
;title_1=title这是板子的IP"{TAB}"
;*****************************************************************************************
BlockInput(1) ;屏蔽/启用鼠标与键盘(输入).
$var = ControlGetText("TCP/IP 地址", "", "[ID:1025]") ;获取指定控件上的文本.
ControlClick( "TCP/IP 地址", "", "[ID:1025]")
Send($title);用快捷方式打开文件 ;sendx的声明(sendx可以输入中文不会乱码)#include <ACN_String.au3> 是声明
ControlClick( "TCP/IP 地址", "添加(&A)", "[ID:1]")
BlockInput(0)
;*****************************************************************************************
ControlClick("高级 TCP/IP 设置","确定","[ID:1]")
ControlClick("Internet 协议 (TCP/IP) 属性","确定","[ID:1]")
ControlClick("本地连接 属性","确定","[ID:1]")
ControlClick("本地连接 状态","关闭(&C)","[ID:2]")
;*****************************************************************************************
Sleep(6000)
WinClose("网络连接")
这是XP下我写的