knightseal 发表于 2010-3-26 09:54:20

求这个IP设置工具的源码

本帖最后由 knightseal 于 2010-3-26 09:58 编辑

1.前2天发求教贴没人指点,但是我还是想找找咋么解决。再论坛前段时间看见这个IP设置工具,和我自己想做的 很类似,所以想问是哪位做的,另外是否可以放出源码,供大家学习,虽然这是一个很常见的设置工具,但是我觉得很经典,跪求源码
2.下面就是截图

3.下面是这个工具 我方附件里了,
再次希望哪位大哥有空的时候帮我看看 !谢谢

这是前2天我发的 求教贴,http://www.autoitx.com/forum.php?mod=viewthread&tid=13834&highlight=ip%2B%B2%BB%CA%C7%D2%D4%C7%B0
就是问问 我GUI做好界面 复制到编辑器中, 设置了 事件,但是点击按钮 不执行命令 也不报错

anchie 发表于 2010-3-26 10:02:18

这个工具怎么看上去那么熟啊?

knightseal 发表于 2010-3-26 11:14:50

:face (13):楼上写的?

gaozhenghong 发表于 2010-3-26 11:21:02

下载个看看先,有源码吗

gaozhenghong 发表于 2010-3-26 11:21:27

我想写个有INI文件的,

gaozhenghong 发表于 2010-3-26 11:22:01

还能备份现在本机IP地址的

gaozhenghong 发表于 2010-3-26 11:22:14

有没有高手指点一下呢

gaozhenghong 发表于 2010-3-26 11:22:30

操作系统是WIN7的

knightseal 发表于 2010-3-26 11:34:19

来人啊 ,帮我们解决一下,:face (30):

chenronting 发表于 2010-3-26 12:03:18

自己去搜索一下 。。 再按图索骥仿做一。。个

a62105400 发表于 2010-3-26 12:28:42

本帖最后由 a62105400 于 2010-3-26 12:32 编辑

#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, "192.168.1.241")
$DNS = _GUICtrlIpAddress_Create($Form1_1, 72, 161, 145, 19)
_GUICtrlIpAddress_Set($DNS, "61.187.191.3")
$DNS2 = _GUICtrlIpAddress_Create($Form1_1, 72, 180, 145, 19)
_GUICtrlIpAddress_Set($DNS2, "202.103.96.68")
$GW = _GUICtrlIpAddress_Create($Form1_1, 72, 124, 145, 19)
_GUICtrlIpAddress_Set($GW, "192.168.1.252")
$Mask = _GUICtrlIpAddress_Create($Form1_1, 72, 91, 145, 19)
_GUICtrlIpAddress_Set($Mask, "255.255.255.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
                                                MsgBox(0,"",_GUICtrlIpAddress_Get($ip))
                                               
                        $rc=_RunDOS("netsh interface ip set address ""本地连接 3"" static "&_GUICtrlIpAddress_Get($ip)&" "&_GUICtrlIpAddress_Get($Mask)&" "&_GUICtrlIpAddress_Get($GW))
                        ;_RunDOS("netsh interface ip set address name=""本地连接"" gateway="&$GW&" gwmetric=0")
                        _RunDOS("netsh interface ip set dns name=""本地连接 3"" source=static addr="&_GUICtrlIpAddress_Get($dns))
                                                _RunDOS("netsh interface ip add dns name=""本地连接 3"" "&_GUICtrlIpAddress_Get($dns2))
                              

      EndSwitch
WEnd
我有3个网卡 当前是 本地连接 3(name用 netsh dump查看)

knightseal 发表于 2010-3-26 13:44:36

谢谢!我等一下测试一下

weeks4 发表于 2010-3-27 17:22:38

真是好啊真是好啊

anchie 发表于 2010-3-27 18:42:36

不支持多网卡的 要源码干吗?
我不是有发源码吗?

knightseal 发表于 2010-3-31 13:34:51

#include
#include
#include
#include
#include
#include
#include
#include
#Region ###...
a62105400 发表于 2010-3-26 12:28 http://www.autoitx.com/images/common/back.gif
只有DNS改了,但是IP mask gw 都没有变化
页: [1] 2
查看完整版本: 求这个IP设置工具的源码