奇怪的错误,请高人帮忙调试
#include <GUIConstantsEx.au3>#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
Dim $const=1
While $const=1
HotKeySet("F10","password")
Func password()
$Form1 = GUICreate("请输入密码",175, 2)
$Input1 = GUICtrlCreateInput("", 8, 8)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndFunc
WEnd 语法上没发现错误
但是无法通过编译
请高手帮忙调试 语法上我检查了多遍
确定不存在任何错误
但是总是无法通过编译
不知道是什么原因
请高手指教 #include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
Dim $const=1
While $const=1
HotKeySet("F10","password")
Func password()
$Form1 = GUICreate("请输入密码",175, 2,$WS_CHILD)
$Input1 = GUICtrlCreateInput("", 8, 8)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndFunc
WEnd 两段代码均无法通过编译
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
Dim $const = 1
While $const = 1
HotKeySet("F10", "password")
password()
WEnd
Func password()
$Form1 = GUICreate("请输入密码", 175, 2)
$Input1 = GUICtrlCreateInput("", 8, 8)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndFunc ;==>password
楼上正解
While里不能 定义Func 回复 6# 南一
哇,你啥时候回来啦!!!!!
不过偶测试楼主的原代码,结果如下图:
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
HotKeySet("{F10}","password")
While 1
sleep(10)
WEnd
Func password()
HotKeySet("{F10}","password2")
$Form1 = GUICreate("请输入密码",214, 40)
$Input1 = GUICtrlCreateInput("", 8, 8)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndFunc
Func password2()
EndFunc HotKeySet("{F10}","password")
While 1
sleep(10)
WEnd
Func password()
$Input1 = InputBox("安全性检查", "输入你的密码.", "", "*")
If $input1=="abcdefg" Then
MsgBox(0,0,"此处执行你的代码")
Exit
Else
MsgBox(0,0,"密码错,重新输入")
password()
EndIf
EndFunc 10楼的才可以,两个while放一起,,!!!!!!!{:face (382):} 回复 8# lchl0588
我有时候会来下,但基本山不回帖,惜字如金啊。 学习学习了, #include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
Dim $const=1
HotKeySet("{F10}","password")
While $const=1
Sleep(100)
WEnd
Func password()
$Form1 = GUICreate("请输入密码",200, 50,-1,-1)
$Input1 = GUICtrlCreateInput("", 8, 8,175,20)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndFunc 都写的差不多了。就说下我的看法吧
就是 func 不管在哪里都好。就是不能放到循环里。
他只要一个调用就行了。你放进去 没用。还显的乱了。
他们是独立的小结构,OVEr
页:
[1]