找回密码
 加入
搜索
查看: 1414|回复: 4

按钮代码问题

[复制链接]
发表于 2008-11-21 07:18:57 | 显示全部楼层 |阅读模式
#include <Process.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
        Local $Button_1, $msg
        GUICreate("My GUI Button")
        Opt("GUICoordMode", 2)
$Form1 = GUICreate("Form1", 314, 130, 192, 114)
$sh = GUICtrlCreateInput("输入IP", 88, 40, 161, 21)
$Button1 = GUICtrlCreateButton("确定", 104, 64, 89, 33, 0)
GUISetState()
#EndRegion ### END Koda GUI section ###
        While 1
                $msg = GUIGetMsg()
                Select
                        Case $msg = $GUI_EVENT_CLOSE
                                ExitLoop
                        Case $msg = $Button_1
$rp = _RunDOS("ping $sh -n 1 -w 2")
If $rp = 1 Then
MsgBox(0, "提示", "电脑关机")
EXIT
EndIf
MsgBox(0, "提示", "电脑开启")
这段代码那里出错了啊?帮忙提示下!!新手

[ 本帖最后由 小凯 于 2008-11-23 05:13 编辑 ]
发表于 2008-11-21 09:38:36 | 显示全部楼层

回复 1# 小凯 的帖子

呃...为什么无法运行?这个偶不知道,但是你这个代码中少了个Wend
 楼主| 发表于 2008-11-21 19:06:18 | 显示全部楼层
这好像不是关键。。没高手给解说下吗```
发表于 2008-11-21 19:10:56 | 显示全部楼层
多看看帮助文件吧。
语法上的错误,帮了这次帮不了下次的。
au3不同与BAT
发表于 2008-11-21 23:29:36 | 显示全部楼层
$rp = _RunDOS("ping " &GUICtrlRead($sh)&" -n 1 -w 2")
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-17 19:15 , Processed in 0.069520 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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