找回密码
 加入
搜索
查看: 2677|回复: 5

关于输入框数据获得的问题,请指教

  [复制链接]
发表于 2008-10-5 17:16:09 | 显示全部楼层 |阅读模式
点下面的生成按钮后,无法根据输入框中的数据,生成。
#NoTrayIcon
#include <GUIConstants.au3>
#include <Misc.au3> ;导入一个AU3自带文件,主要用其防止重复运行程序的函数
_Singleton("TheNameOfMy") ;这个函数就是用来检测是否有相同程序在运行如果有则退出,就是只运行一次

#Region ;**** 参数创建于 AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=游戏外挂.ico
#AutoIt3Wrapper_Res_Comment=Pubwin自动开卡程序数据库初始化生成工具
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****


GUICreate("Pubwin自动开卡程序--数据库初始化生成工具", 350, 300)   ; 创建一个居中的窗口
GUISetState (@SW_SHOW)        ; 显示窗口
GUICtrlCreateGroup("起始数据编号", 10, 10, 330, 60)
$s1 = GUICtrlCreateInput ( "", "20", "32", "310" , "20" )

GUICtrlCreateGroup("需生成的数据量", 10, 100, 330, 60)
$s2 = GUICtrlCreateInput ( "", "20", "122", "310" , "20" )

GUICtrlCreateGroup("起始卡号", 10, 190, 330, 60)
$s3 = GUICtrlCreateInput ( "", "20", "212", "310" , "20" )

$Button1=guictrlcreatebutton("生成",70,265,50,20)
$Button2=guictrlcreatebutton("退出",220,265,50,20)

; ; 运行脚本直到窗口被关闭
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
                        $i = 1
                        While $i <= $s2
                        IniWrite ( "Pubwin初始数据库.ini", $s1, "卡号", $s3 )
                        IniWrite ( "Pubwin初始数据库.ini", $s1, "姓名", "" )
                        IniWrite ( "Pubwin初始数据库.ini", $s1, "身份证", "" )
                        IniWrite ( "Pubwin初始数据库.ini", $s1, "性别", "" )
                        IniWrite ( "Pubwin初始数据库.ini", $s1, "住址", "" )
                        IniWrite ( "Pubwin初始数据库.ini", $s1, "单位", "" )
                        IniWrite ( "Pubwin初始数据库.ini", $s1, "发证机构", "" )
                        IniWrite ( "Pubwin初始数据库.ini", $s1, "详细", "" )
                        $s1 = $s1 + 1
                        $s3 = $s3 + 1
                        $i = $i + 1
                        WEnd
            MsgBox ( 0, "提示", "数据库初始化完成,请确认数据生成正常,改名后使用。")
        Case $Button2
            Exit
    EndSwitch
WEnd
 楼主| 发表于 2008-10-5 17:17:28 | 显示全部楼层

本帖子中包含更多资源

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

×
发表于 2008-10-5 19:24:33 | 显示全部楼层
明显的逻辑错误!
发表于 2008-10-5 20:01:33 | 显示全部楼层

#NoTrayIcon
#include <GUIConstants.au3>
#include <Misc.au3> ;导入一个AU3自带文件,主要用其防止重复运行程序的函数
_Singleton("TheNameOfMy") ;这个函数就是用来检测是否有相同程序在运行如果有则退出,就是只运行一次

#Region ;**** 参数创建于 AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=游戏外挂.ico
#AutoIt3Wrapper_Res_Comment=Pubwin自动开卡程序数据库初始化生成工具
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****


GUICreate("Pubwin自动开卡程序--数据库初始化生成工具", 350, 300) ; 创建一个居中的窗口
GUISetState(@SW_SHOW) ; 显示窗口
GUICtrlCreateGroup("起始数据编号", 10, 10, 330, 60)
$s1 = GUICtrlCreateInput("", "20", "32", "310", "20")

GUICtrlCreateGroup("需生成的数据量", 10, 100, 330, 60)
$s2 = GUICtrlCreateInput("", "20", "122", "310", "20")

GUICtrlCreateGroup("起始卡号", 10, 190, 330, 60)
$s3 = GUICtrlCreateInput("", "20", "212", "310", "20")

$Button1 = GUICtrlCreateButton("生成", 70, 265, 50, 20)
$Button2 = GUICtrlCreateButton("退出", 220, 265, 50, 20)

; ; 运行脚本直到窗口被关闭
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $1 = GUICtrlRead($s1)
                        $2 = GUICtrlRead($s2)
                        $3 = GUICtrlRead($s3)
                        For $i = $1 To ($1 + $2 - 1)
                                IniWrite("Pubwin初始数据库.ini", $i, "卡号", $3)
                                IniWrite("Pubwin初始数据库.ini", $i, "姓名", "")
                                IniWrite("Pubwin初始数据库.ini", $i, "身份证", "")
                                IniWrite("Pubwin初始数据库.ini", $i, "性别", "")
                                IniWrite("Pubwin初始数据库.ini", $i, "住址", "")
                                IniWrite("Pubwin初始数据库.ini", $i, "单位", "")
                                IniWrite("Pubwin初始数据库.ini", $i, "发证机构", "")
                                IniWrite("Pubwin初始数据库.ini", $i, "详细", "")
                                $3 = $3 + 1
                        Next
                        MsgBox(0, "提示", "数据库初始化完成,请确认数据生成正常,改名后使用。")
                Case $Button2
                        Exit
        EndSwitch
WEnd
 楼主| 发表于 2008-10-6 09:14:32 | 显示全部楼层
刚学,还有很多不懂,以后请大侠们多多指教
发表于 2008-10-6 10:12:52 | 显示全部楼层
原帖由 alongsoft 于 2008-10-6 09:14 发表
刚学,还有很多不懂,以后请大侠们多多指教


我是能帮就帮,不能帮也帮着想个解决办法...
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-19 15:32 , Processed in 0.078808 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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