找回密码
 加入
搜索
查看: 7096|回复: 16

[系统综合] 求这个IP设置工具的源码

  [复制链接]
发表于 2010-3-26 09:54:20 | 显示全部楼层 |阅读模式
本帖最后由 knightseal 于 2010-3-26 09:58 编辑

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

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

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

本帖子中包含更多资源

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

×
发表于 2010-3-26 10:02:18 | 显示全部楼层
这个工具怎么看上去那么熟啊?
 楼主| 发表于 2010-3-26 11:14:50 | 显示全部楼层
楼上写的?
发表于 2010-3-26 11:21:02 | 显示全部楼层
下载个看看先,有源码吗
发表于 2010-3-26 11:21:27 | 显示全部楼层
我想写个有INI文件的,
发表于 2010-3-26 11:22:01 | 显示全部楼层
还能备份现在本机IP地址的
发表于 2010-3-26 11:22:14 | 显示全部楼层
有没有高手指点一下呢
发表于 2010-3-26 11:22:30 | 显示全部楼层
操作系统是WIN7的
 楼主| 发表于 2010-3-26 11:34:19 | 显示全部楼层
来人啊 ,帮我们解决一下,
发表于 2010-3-26 12:03:18 | 显示全部楼层
自己去搜索一下 。。 再按图索骥仿做一。。个
发表于 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查看)
 楼主| 发表于 2010-3-26 13:44:36 | 显示全部楼层
谢谢!我等一下测试一下
发表于 2010-3-27 17:22:38 | 显示全部楼层
真是好啊真是好啊
发表于 2010-3-27 18:42:36 | 显示全部楼层
不支持多网卡的 要源码干吗?
我不是有发源码吗?
 楼主| 发表于 2010-3-31 13:34:51 | 显示全部楼层
#include
#include
#include
#include
#include
#include
#include
#include
#Region ###  ...
a62105400 发表于 2010-3-26 12:28

只有DNS改了,但是IP mask gw 都没有变化
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-20 16:52 , Processed in 0.088739 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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