找回密码
 加入
搜索
查看: 2235|回复: 7

[系统综合] 我需要完成如下截图中的功能,不知道代码如何写

  [复制链接]
发表于 2016-7-28 10:24:22 | 显示全部楼层 |阅读模式
我有一个代码是截图所示的,不知道如何实现。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2016-7-28 10:25:58 | 显示全部楼层
GUICtrlCreateGroup
--------------------------------------------------------------------------------

Creates a Group control for the GUI.


GUICtrlCreateGroup ( "text", left, top [, width [, height [, style [, exStyle]]]] )




Parameters

text The text of the control.
left The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width [optional] The width of the control (default is the previously used width).
height [optional] The height of the control (default is the previously used height).
style [optional] Defines the style of the control. See GUI Control Styles Appendix.
default ( -1) : none.
forced styles : $WS_GROUP, $BS_GROUPBOX.
exStyle [optional] Defines the extended style of the control. See Extended Style Table.



Return Value

Success: Returns the identifier (controlID) of the new control.
Failure: Returns 0.



Remarks

A group control is the thin line you see around controls (usually only Radio button) that visually groups them together. Only one Radio button within a Group can be selected at once.
If you want to have multiple groups without the visible line then you must use GUIStartGroup() to group your Radio buttons.

To use the values specified above you must #include <ButtonConstants.au3> in your script.

Default resizing is $GUI_DOCKAUTO size and position will occur.
发表于 2016-7-28 11:27:10 | 显示全部楼层
include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <ACN_NET.au3>
#include <Inet.au3>
    Local $msg
    Dim $net
    GUICreate("My GUI") ; 
    GUISetState(@SW_SHOW) ; 
        GUICtrlCreateGroup("信息区",10,100,300,200)
        
        GUICtrlCreateLabel("IP地址  :",20,120,-1,-1)
     $hIP_Input = GUICtrlCreateInput(" ", 120, 120, 150, -1)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
        GUICtrlSetData($hIP_Input, @IPAddress1)
        GUICtrlCreateLabel("子网掩码  :",20,140,-1,-1)
        $net_Input =GUICtrlCreateInput(" ", 120, 140, 150, -1)
        net()
        GUICtrlSetData($net_Input,$net)
        GUICtrlCreateLabel("默认网关  :",20,160,-1,-1)
        $hmask_Input = GUICtrlCreateInput(" ", 120, 160, 150, -1)
        GUICtrlSetData($hmask_Input, _Gateway())
        
        GUICtrlCreateLabel("MAC地址  :",20,180,-1,-1)
        $hmac_Input = GUICtrlCreateInput("",120,180,150,-1)
        GUICtrlSetData($hmac_Input,_API_Get_NetworkAdapterMAC(@IPAddress1))
        GUICtrlCreateLabel("公网IP地址  :",20,200,-1,-1)
        $pip_Input = GUICtrlCreateInput("",120,200,150,-1)
        GUICtrlSetData($pip_Input,public_ip())
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()

Func _Gateway()
        Dim $IPGateway
        Dim $objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
        Dim $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = TRUE", "WQL", 0x10 + 0x20)
        For $objItem In $colItems
                $IPGateway = $objItem.DefaultIPGateway(0)
                If StringInStr($IPGateway, ".") > 0 Then ExitLoop
        Next
        Return StringRegExpReplace($IPGateway, '(\d+\.){12}', '')
        EndFunc   ;==>_Gateway
        
Func public_ip()
        Local $source = _INetGetSource("http://ip.qq.com")
        Local $aIP = StringRegExp($source, '您当前的IP为.*?(\d[\d.]+)', 3, 1)
        If Not @error Then
                Return $aIP[0]
        Else
                Return 0
        EndIf
        EndFunc   

Func net()
        
Dim $objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
Dim $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = TRUE", "WQL", 0x10 + 0x20)
For $objItem In $colItems
$net =$objItem.IPSubnet(0) 
Next
     
EndFunc   ;==>_Gateway

评分

参与人数 1金钱 +10 收起 理由
heroxianf + 10

查看全部评分

 楼主| 发表于 2016-7-28 15:43:17 | 显示全部楼层
@ffcloudy
你的代码,我测试了,有如下错误。! 截图如下
 楼主| 发表于 2016-7-28 15:45:55 | 显示全部楼层
@ffcloudy
你的代码,我测试了,有如下错误。! 截图如下

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2016-7-28 18:13:04 | 显示全部楼层
回复 5# cm84n7281


看看自己有没有ACN_NET.au3函数吧
发表于 2016-8-3 13:53:16 | 显示全部楼层
好熟悉的界面。哈哈 。njsf的人?新手的话建议你先吧界面画出来,然后单独msgbox 测试把想要的信息取出来,最后合并就好啦。
发表于 2016-8-11 11:29:13 | 显示全部楼层
不是很明白你的意思
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-19 21:27 , Processed in 0.083373 second(s), 28 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表