找回密码
 加入
搜索
查看: 2283|回复: 2

关于两个GUI窗口请教?

[复制链接]
发表于 2008-6-15 18:57:28 | 显示全部楼层 |阅读模式
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.12.0
Author:         myName

Script Function:
        Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <string.au3>

$g_szVersion = "My_bxp"
If WinExists($g_szVersion) Then Exit ; 此脚本已经运行了
AutoItWinSetTitle($g_szVersion)

fileinstall("top.jpg",@tempdir &"\top.jpg")

$passwrad = _StringEncrypt(1,"admin","chasedream",1)
if not FileExists(@scriptdir &"\pz.ini") Then
        iniwrite(@ScriptDir &"\pz.ini","user","user","admin")
    iniwrite(@ScriptDir &"\pz.ini","user","pass",$passwrad)
EndIf

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Bxp_Log in", 311, 119, 193, 125)
GUICtrlCreateLabel("User:", 128, 16, 29, 17)
GUICtrlCreateLabel("Pass:", 128, 48, 30, 17)
$user = GUICtrlCreateInput("", 168, 16, 121, 21)
$pass = GUICtrlCreateInput("", 168, 48, 121, 21,$ES_PASSWORD)
$log_in = GUICtrlCreateButton("Log me In", 232, 80, 59, 25, 0)
GUICtrlCreatePic(@tempdir &"\top.jpg", 8, 8, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
        Case $GUI_EVENT_CLOSE
                Exit
        Case $log_in
                login()
        EndSwitch
WEnd

Func login()
$user_a = iniread(@scriptdir &"\pz.ini","user","user","")
$pass_a = iniread(@scriptdir &"\pz.ini","user","pass","")
$pass_c = _StringEncrypt(0,$pass_a,"chasedream",1)
$user_b = GUICtrlRead($user)
$pass_b = GUICtrlRead($pass)
if $user_a = $user_b or $pass_c = $pass_b Then
        games()
        Else
        MsgBox("16","提示:","帐号或密码错误,请重新输入!")
EndIf
EndFunc

Func games()
        #Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Bxp_游戏管理", 429, 228, 193, 125)
$Button1 = GUICtrlCreateButton("磁盘加载", 24, 24, 75, 25, 0)
$Button2 = GUICtrlCreateButton("游戏升级", 24, 64, 75, 25, 0)
$Button3 = GUICtrlCreateButton("游戏目录", 24, 104, 75, 25, 0)
$Button4 = GUICtrlCreateButton("游戏菜单", 24, 144, 75, 25, 0)
GUICtrlCreateEdit("", 112, 24, 289, 185)
$Button5 = GUICtrlCreateButton("退出程序", 24, 184, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button5
                        Exit

        EndSwitch
WEnd
        EndFunc


请问,需要怎么更改,才能使登陆成功以后,出现第2个GUI,第一个GUI,消失?

[ 本帖最后由 chasedream 于 2008-6-16 19:42 编辑 ]

本帖子中包含更多资源

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

×
发表于 2008-6-15 19:25:32 | 显示全部楼层
GUIDelete ($Form1)

评分

参与人数 1金钱 +5 收起 理由
chasedream + 5 谢谢,测试成功!

查看全部评分

 楼主| 发表于 2008-6-15 20:00:44 | 显示全部楼层
感谢,感谢,测试以后,成功就给你加分.
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-27 06:50 , Processed in 0.070429 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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