关于我们┊AboutMe

昵称:Hopol(■童■)

联系:QQ:18883

邮箱:info(at)18883.com

主页:www.18883.com

手机浏览 日志归档 RSS 2.0 订阅
Register | Login

用au3编写网管维护工具教程 (图文)

首先要先设计个维护面板

大小: 46.5 K
尺寸: 150 x 135
浏览: 62 次
点击打开新窗口浏览全图

大小: 26.95 K
尺寸: 150 x 44
浏览: 36 次
点击打开新窗口浏览全图

大小: 26.52 K
尺寸: 150 x 104
浏览: 24 次
点击打开新窗口浏览全图

大小: 25.44 K
尺寸: 150 x 40
浏览: 21 次
点击打开新窗口浏览全图

大小: 14.48 K
尺寸: 150 x 62
浏览: 14 次
点击打开新窗口浏览全图

大小: 28.25 K
尺寸: 150 x 120
浏览: 23 次
点击打开新窗口浏览全图

大小: 60.44 K
尺寸: 150 x 118
浏览: 24 次
点击打开新窗口浏览全图

设计完以后 把窗口生成器生成的代码 复制到SCITE编辑器里 红色部分就是需要我们写上去的代码
在SCITE里新建一个脚本 然后复制进去
#include <GUIConstants.au3>
#include <Process.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("维护工具", 251, 81, 297, 252)
$Button1 = GUICtrlCreateButton("控制面版", 20, 8, 75, 25, 0)
$Button2 = GUICtrlCreateButton("显示属性", 20, 48, 75, 25, 0)
$Button3 = GUICtrlCreateButton("系统属性", 132, 8, 75, 25, 0)
$Button4 = GUICtrlCreateButton("进程管理", 132, 48, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
RunWait("c:\windows\system32\control.exe"); 打开控制面板

Case $Button2
_rundos("C:\windows\system32\desk.cpl");打开显示属性

Case $Button3
_RunDOS("c:\windows\system32\sysdm.cpl");打开系统属性

Case $Button4
RunWait("c:\windows\system32\taskmgr.exe");打开任务管理器
EndSwitch
WEnd


=============================================================================
留给新手的反思 为什么调用exe文件 用runwait 调用cpl文件用 _rundos??
如果用别的方法可不可以?

大小: 14.14 K
尺寸: 150 x 25
浏览: 7 次
点击打开新窗口浏览全图

大小: 13.74 K
尺寸: 150 x 54
浏览: 12 次
点击打开新窗口浏览全图

大小: 20.33 K
尺寸: 150 x 78
浏览: 11 次
点击打开新窗口浏览全图

大小: 14.05 K
尺寸: 150 x 52
浏览: 16 次
点击打开新窗口浏览全图


网管维护工具


#include <GUIConstants.au3>
#include <Process.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("维护工具测试1", 315, 204, 278, 206)
$Button1 = GUICtrlCreateButton("系统属性", 8, 8, 75, 25, 0)
$Button2 = GUICtrlCreateButton("显示属性", 8, 56, 75, 25, 0)
$Button3 = GUICtrlCreateButton("进程管理", 8, 104, 75, 25, 0)
$Button4 = GUICtrlCreateButton("控制面板", 112, 8, 75, 25, 0)
$Button5 = GUICtrlCreateButton("命令行", 112, 56, 75, 25, 0)
$Button6 = GUICtrlCreateButton("注册表", 112, 104, 75, 25, 0)
$Button7 = GUICtrlCreateButton("Msconfig", 216, 56, 75, 25, 0)
$Button8 = GUICtrlCreateButton("音量控制", 216, 104, 75, 25, 0)
$Button9 = GUICtrlCreateButton("策略组", 216, 8, 75, 25, 0)
$Input1 = GUICtrlCreateInput("", 8, 148, 121, 25)
$Button10 = GUICtrlCreateButton("运行", 144, 148, 43, 25, 0)
$Button11 = GUICtrlCreateButton("时间日期", 216, 144, 75, 25, 0)
GUICtrlCreateLabel("", 184, 176, 4, 4)
$Label1 = GUICtrlCreateLabel("蝶-友川医夫2007/11", 176, 186, 132, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_RunDOS(@SystemDir &"\sysdm.cpl");打开系统属性
Case $Button2
_RunDOS(@SystemDir &"\desk.cpl");打开显示属性
Case $Button3
Run(@SystemDir &"\taskmgr.exe");打开任务管理器
Case $Button4
Run(@SystemDir &"\control.exe");打开控制面板
Case $Button5
Run(@SystemDir &"\cmd.exe");打开命令行
Case $Button6
Run(@WindowsDir &"\regedit.exe");打开注册表
Case $Button7
Run("C:\WINDOWS\pchealth\helpctr\binaries\Msconfig.exe");打开msconfig
Case $Button8
Run(@SystemDir &"\Sndvol32.exe");打开音量控制程序
Case $Button9
ShellExecute(@SystemDir &"\gpedit.msc");打开策略组 另一种写法Run(@ComSpec&' /c gpedit.msc',@SystemDir,@SW_HIDE)
Case $Button10
Run(@ComSpec &" /c"&GUICtrlRead($input1));这里是这个作品的关键 读取文本框里的内容然后运行
Case $Button11
_RunDOS(@SystemDir &"\timedate.cpl");打开时间日期
Case $Label1
EndSwitch
WEnd

说明:
au3的库文件 @systemdir==windows\systemdir @windowsdir==windows 

大小: 58.3 K
尺寸: 150 x 98
浏览: 21 次
点击打开新窗口浏览全图

大小: 86.19 K
尺寸: 150 x 126
浏览: 20 次
点击打开新窗口浏览全图

大小: 53.73 K
尺寸: 134 x 150
浏览: 10 次
点击打开新窗口浏览全图

大小: 20.09 K
尺寸: 150 x 106
浏览: 16 次
点击打开新窗口浏览全图

Tags: au3, autoit, 网管, 维护工具, 教程

« 上一篇 | 下一篇 »

只显示10条记录相关文章

AU3热血江湖群医辅助工具 (浏览: 487, 评论: 0)
AU3---简单任务管理器 (浏览: 442, 评论: 0)
MyBc_V4.6 完整源码 (浏览: 457, 评论: 0)
锐起绿色连接器完全后台版 au3源码 (浏览: 471, 评论: 0)
劲舞团3.1启动器代码 au3源码 (浏览: 467, 评论: 0)
YG2007播放器的安装源码 (浏览: 447, 评论: 0)
AU3-调用user32.dll来做随即启动GUI界面 (浏览: 434, 评论: 0)
音量控制原码 au3源码 (浏览: 422, 评论: 0)
游戏自动更新 au3源码 (浏览: 406, 评论: 0)
网吧进程窗口封杀 au3源码 (浏览: 458, 评论: 0)

发表评论