找回密码
 加入
搜索
查看: 2016|回复: 0

[AU3基础] Ip地址修改工具问题请教(不是以前问的那些)

[复制链接]
发表于 2010-3-24 15:49:19 | 显示全部楼层 |阅读模式
本帖最后由 knightseal 于 2010-3-24 15:51 编辑

1.实际上还是老问题,就是关于制作IP修改器的问题
2.下面是我的代码,
3.问题是可以编译但是使用软件时点击确定 ,ip地址改不了,请告诉我问题出在哪里!

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiIPAddress.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
#Region ### START Koda GUI section ### Form=c:\documents and settings\administrator\my documents\au3\服务器基本环境设置.kxf
$Form1_1 = GUICreate("test", 633, 447, 192, 124)
GUISetBkColor(0xFFFFFF)
$Group1 = GUICtrlCreateGroup("test", 12, 11, 609, 425)
$Button1 = GUICtrlCreateButton("确定", 240, 304, 113, 25)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$IP= _GUICtrlIpAddress_Create($Form1_1, 72, 56, 145, 19)
_GUICtrlIpAddress_Set($IP, "0.0.0.0")
$DNS = _GUICtrlIpAddress_Create($Form1_1, 72, 161, 145, 19)
_GUICtrlIpAddress_Set($DNS, "0.0.0.0")
$GW = _GUICtrlIpAddress_Create($Form1_1, 72, 124, 145, 19)
_GUICtrlIpAddress_Set($GW, "0.0.0.0")
$Mask = _GUICtrlIpAddress_Create($Form1_1, 72, 91, 145, 19)
_GUICtrlIpAddress_Set($Mask, "0.0.0.0")
$HostName = GUICtrlCreateInput("HostName", 360, 80, 169, 21)
$port = GUICtrlCreateInput("Port", 360, 126, 169, 21)
$Label1 = GUICtrlCreateLabel("IP", 32, 56, 14, 17)
$Label2 = GUICtrlCreateLabel("Mask", 32, 93, 30, 17)
$Label3 = GUICtrlCreateLabel("GW", 32, 125, 23, 17)
$Label4 = GUICtrlCreateLabel("DNS", 32, 165, 27, 17)
$Label5 = GUICtrlCreateLabel("说明:这是一次测试", 76, 376, 425, 17)
$Progress1 = GUICtrlCreateProgress(76, 408, 505, 17)
GUICtrlSetColor(-1, 0x008080)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

        While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $rc=_RunDOS("netsh interface ip set address name=""本地连接"" source=static addr="&$IP&" mask="&$Mask&"")
                        _RunDOS("netsh interface ip set address name=""本地连接"" gateway="&$GW&" gwmetric=0")
                        _RunDOS("netsh interface ip set dns name=""本地连接"" source=static addr="&$dns&" register=PRIMARY")
                               

        EndSwitch
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-20 20:16 , Processed in 0.077896 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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