找回密码
 加入
搜索
查看: 4959|回复: 14

[GUI管理] 奇怪的错误,请高人帮忙调试

  [复制链接]
发表于 2010-7-6 11:56:04 | 显示全部楼层 |阅读模式
#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
 楼主| 发表于 2010-7-6 11:57:44 | 显示全部楼层
语法上没发现错误
但是无法通过编译
请高手帮忙调试

本帖子中包含更多资源

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

×
 楼主| 发表于 2010-7-6 12:00:28 | 显示全部楼层
语法上我检查了多遍
确定不存在任何错误
但是总是无法通过编译
不知道是什么原因
请高手指教
 楼主| 发表于 2010-7-6 12:01:25 | 显示全部楼层
#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
 楼主| 发表于 2010-7-6 12:01:51 | 显示全部楼层
两段代码均无法通过编译
发表于 2010-7-6 12:02:55 | 显示全部楼层
#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

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-7-6 12:38:45 | 显示全部楼层
楼上正解
While里不能 定义Func

评分

参与人数 1金钱 +10 收起 理由
afan + 10

查看全部评分

发表于 2010-7-6 13:04:08 | 显示全部楼层
回复 6# 南一
哇,你啥时候回来啦!!!!!


不过偶测试楼主的原代码,结果如下图:

本帖子中包含更多资源

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

×
发表于 2010-7-6 13:15:47 | 显示全部楼层
#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

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-7-6 13:49:08 | 显示全部楼层
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

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-7-6 16:34:15 | 显示全部楼层
10楼的才可以,两个while放一起,,!!!!!!!
发表于 2010-7-6 17:12:55 | 显示全部楼层
回复 8# lchl0588

我有时候会来下,但基本山不回帖,惜字如金啊。
发表于 2010-7-7 09:04:23 | 显示全部楼层
学习学习了,
发表于 2010-7-7 09:25:16 | 显示全部楼层
#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
发表于 2010-7-7 10:06:52 | 显示全部楼层
都写的差不多了。就说下我的看法吧
就是 func 不管在哪里都好。就是不能放到循环里。
他只要一个调用就行了。你放进去 没用。还显的乱了。
他们是独立的小结构,OVEr
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-19 00:33 , Processed in 0.105438 second(s), 32 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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