找回密码
 加入
搜索
查看: 2561|回复: 3

[AU3基础] [已解决]INI文件写入 求助!!!!

[复制链接]
发表于 2013-9-25 12:01:55 | 显示全部楼层 |阅读模式
本帖最后由 laomeng 于 2014-5-14 22:46 编辑
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Opt("GUIOnEventMode", 1)
Global $start, $Num, $time, $timeS, $NumS = 1
Global $ini = @ScriptDir & "\DEFAULT.ini"
IniWrite($ini,"TEST","TIME","1200")
Local $time1 = IniRead ($ini,"TEST","TIME","err")
$Form1 = GUICreate("Form1", 659, 538, 192, 124)
GUISetBkColor(0x555555)
;$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Administrator\桌面\linux\111.jpg", 0, 0, 659, 538)
;GUICtrlSetState(-1,$GUI_DISABLE)
#cs
$Group1 = GUICtrlCreateGroup("Group1", 8, 152, 641, 361)
;GUICtrlSetData(-1, "port--->:")
$Label1 = GUICtrlCreateLabel("Port1", 16, 200, 68, 17)
$Label2 = GUICtrlCreateLabel("Port2", 16, 232, 68, 17)
$Label3 = GUICtrlCreateLabel("Port3", 16, 264, 68, 17)
$Label4 = GUICtrlCreateLabel("Port4", 16, 304, 68, 17)
$Label5 = GUICtrlCreateLabel("Port5", 16, 344, 68, 25)
$Label6 = GUICtrlCreateLabel("Port6", 16, 392, 60, 17)
$Label7 = GUICtrlCreateLabel("Port7", 16, 432, 68, 17)
$Label8 = GUICtrlCreateLabel("Port8", 16, 472, 68, 17)
$Label9 = GUICtrlCreateLabel("Port9", 352, 200, 36, 17)
$Label10 = GUICtrlCreateLabel("Port10", 352, 240, 42, 17)
$Label11 = GUICtrlCreateLabel("Port11", 352, 280, 42, 17)
$Label12 = GUICtrlCreateLabel("Port12", 352, 312, 42, 17)
$Label13 = GUICtrlCreateLabel("Port13", 352, 352, 42, 17)
$Label14 = GUICtrlCreateLabel("Port14", 352, 384, 42, 17)
$Label15 = GUICtrlCreateLabel("Port15", 352, 424, 42, 17)
$Label16 = GUICtrlCreateLabel("Port16", 352, 464, 42, 17)
#ce
$Button1 = GUICtrlCreateButton("开始烧录", 16, 88, 81, 25)
;GUICtrlSetBkColor(-1,0x555555)
$Button2 = GUICtrlCreateButton("退出", 168, 88, 89, 25)
$Label17 = GUICtrlCreateLabel("", 400, 8,180,141)
GUICtrlSetFont(-1, 12, 800, 0)
GUICtrlSetColor(-1, 0x19BD0A)
GUICtrlCreateLabel("烧录次数: ", 450, 110,90,45)
GUICtrlSetFont(-1, 12, 800, 0)
GUICtrlSetColor(-1, 0x2012E2)
$Label18 = GUICtrlCreateLabel("_?", 535, 109, 42, 17)
GUICtrlSetFont(-1, 12, 800, 0)
GUICtrlSetColor(-1, 0xE02ECE)
GUISetState(@SW_SHOW)
G
While 1
        If $start And $timeS < 1 Then _Do_Something() 
                Sleep(10)
        WEnd
        Func CountDown()
        If $NumS = $Num And $Num <> "" Then $start = False
        
                AdlibUnRegister('CountDown')
        EndIf
EndFunc   ;==>CountDown


Func SpecialEvents()
        Switch @GUI_CtrlId
                Case $GUI_EVENT_CLOSE
           
                        Else
                   
        ; execute codes after each countdown.
EndFunc   ;==>_Do_Something
想实现的是: 1.打开本程序 就设定  DEFAULT.ini 中time为1200 S(这个原始的INI文件中没有这个字段,所以要先写入);
2.第二次循环的时候开始写入新的时间  比如  

IniWrite($ini,"TEST","TIME","80")  (以后执行都使用这个时间)

  但是我在_Do_Something()   下面 执行不起作用。

PS:如果关闭本程序再次打开 那么初始时间还是要 为1200 S  

求助        谢谢

新手 不知道怎么实现 。
发表于 2013-9-25 13:02:03 | 显示全部楼层
请看版规。。
 楼主| 发表于 2013-9-25 22:14:26 | 显示全部楼层
帮忙解决下啊
发表于 2013-9-30 20:56:07 | 显示全部楼层
回复 1# laomeng


    楼主,你的QQ是什么?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-28 19:15 , Processed in 0.121318 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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