本帖最后由 lynfr8 于 2010-7-12 00:41 编辑
http://www.autoitx.com/thread-12319-1-1.html
_Ini函数库(含_IniReadSection等系列函数)
-----------------------------------------------------------------------
就拿afan上面的UDF写了一个简单应用范例
其他的(比如GUI用koda自己画就行了)楼主自行拓展
将下面ini和上面下载的_Ini.au3放在同一个文件夹即可测试
-----------------------------------------------------------------------
setting.ini[2010-07-12]
00:37=[这里写你要提醒的事情!]
[2010-07-11]
00:34=[点击重试则一分钟后继续提醒!点击取消则会删除此提醒!]
#include <Array.au3>
#include '_Ini.au3'
While 1
Sleep(100)
$date = _IniReadSectionNames('setting.ini', 0)
For $i = 1 To $date[0]
If $date[$i] = @YEAR & "-" & @MON & "-" & @MDAY Then
$Remind = _IniReadSection('setting.ini', $date[$i], 0)
If $Remind <> 0 Then
For $n = 1 To $Remind[0][0]
If @HOUR & ":" & @MIN = $Remind[$n][0] Then
$Switch = MsgBox(5, $Remind[$n][0], $Remind[$n][1])
If $Switch = 4 Then
$oldRemind = _FileRead('setting.ini', 0)
$File = FileOpen('setting.ini', 2)
FileWrite($File, StringReplace($oldRemind, $Remind[$n][0] & '=' & $Remind[$n][1], @HOUR & ":" & @MIN + 1 & '=' & $Remind[$n][1]))
FileClose($File)
Else
_IniDelete('setting.ini', $date[$i], $Remind[$n][0])
ExitLoop (2)
EndIf
EndIf
Next
EndIf
EndIf
Next
WEnd
|