找回密码
 加入
搜索
查看: 2275|回复: 1

[AU3基础] 请问怎么样同时判断多个输入框是否有数据 [已解决]

[复制链接]
发表于 2010-3-31 12:03:58 | 显示全部楼层 |阅读模式
本帖最后由 261869247 于 2010-3-31 12:11 编辑

我这个要是一个输入框有数据就提示注册成功
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 319, 186, 350, 205)
$Button1 = GUICtrlCreateButton("CS英文ID", 24, 8, 81, 25)
$Button2 = GUICtrlCreateButton("CS中文ID", 24, 40, 81, 25)
$Button3 = GUICtrlCreateButton("你的密码", 24, 72, 81, 25)
$Button4 = GUICtrlCreateButton("确定注册", 72, 144, 81, 25)
$Input1 = GUICtrlCreateInput("", 120, 8, 121, 21)
$Input2 = GUICtrlCreateInput("", 120, 40, 121, 21)
$Input3 = GUICtrlCreateInput("", 120, 72, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$Button5 = GUICtrlCreateButton("你的QQ", 24, 104, 81, 25)
$Input4 = GUICtrlCreateInput("", 120, 104, 121, 21)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

UDPStartup()
$socket = UDPOpen("192.168.0.236", 64213)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
case $Button4
$EN = GUICtrlRead($Input1)
$CN = GUICtrlRead($Input2)
$Pass = GUICtrlRead($Input3)
$QQ = GUICtrlRead($Input4)

$stauts = $EN & $CN & $Pass & $QQ


If $stauts = 0 then 
        MsgBox(16, "错误", "请输入完整你的注册信息")
else    
        UDPSend($socket,StringToBinary ("" & $en & " " & "" & $cn,4));转换并发送二进制数据(支持中文全显示)
        MsgBox(0,"服务器提示","注册成功")
EndIf

EndSwitch
WEnd
 楼主| 发表于 2010-3-31 12:11:35 | 显示全部楼层
本帖最后由 261869247 于 2010-3-31 12:12 编辑
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 319, 186, 350, 205)
$Button1 = GUICtrlCreateButton("CS英文ID", 24, 8, 81, 25)
$Button2 = GUICtrlCreateButton("CS中文ID", 24, 40, 81, 25)
$Button3 = GUICtrlCreateButton("你的密码", 24, 72, 81, 25)
$Button4 = GUICtrlCreateButton("确定注册", 72, 144, 81, 25)
$Input1 = GUICtrlCreateInput("", 120, 8, 121, 21)
$Input2 = GUICtrlCreateInput("", 120, 40, 121, 21)
$Input3 = GUICtrlCreateInput("", 120, 72, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$Button5 = GUICtrlCreateButton("你的QQ", 24, 104, 81, 25)
$Input4 = GUICtrlCreateInput("", 120, 104, 121, 21)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

UDPStartup()
$socket = UDPOpen("192.168.0.236", 64213)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
case $Button4
$EN = GUICtrlRead($Input1)
$CN = GUICtrlRead($Input2)
$Pass = GUICtrlRead($Input3)
$QQ = GUICtrlRead($Input4)

If $EN = 0 then 
        MsgBox(16, "错误", "请输入完整你的注册信息")

ElseIf $CN = 0 then
        MsgBox(16, "错误", "请输入完整你的注册信息")

ElseIf $Pass = 0 then
        MsgBox(16, "错误", "请输入完整你的注册信息")

ElseIf $QQ = 0 then
        MsgBox(16, "错误", "请输入完整你的注册信息")

else    
        UDPSend($socket,StringToBinary ("" & $en & " " & "" & $cn,4));转换并发送二进制数据(支持中文全显示)
        MsgBox(0,"服务器提示","注册成功")
EndIf

EndSwitch
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-18 08:34 , Processed in 0.081960 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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