pchome2000 发表于 2008-12-22 21:29:31

如何循环读取INI文件

For $i=1 To 100
$path = IniRead(@ScriptDir & "\123.ini","DeployPic","Picture"&$i,"")

if $path ="" then
如果$path=""时,重新从picture1开始读取,如何实现

[ 本帖最后由 pchome2000 于 2008-12-24 16:15 编辑 ]

sxd 发表于 2008-12-23 01:12:33

Dim $path
While $path = ""
        For $i = 1 To 100
                $path = IniRead(@ScriptDir & "\123.ini", "DeployPic", "Picture" & $i, "")
        Next
WEnd

pchome2000 发表于 2008-12-23 08:44:43

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Dim $path,$gui,$a

   GUICreate("PIC",@DesktopWidth,@DesktopHeight,-1,-1)
   GUISetState(@SW_SHOW)
While $path = ""
        For $i = 1 To 100
                $path = IniRead(@ScriptDir & "\123.ini", "DeployPic", "Picture" & $i, "")
                GUICtrlDelete($a)
                $a = GUICtrlCreatePic(@HomeDrive & "\" & $path, 0, 0,@DesktopWidth, @DesktopHeight)
                Sleep(3000)
        Next
WEnd不能循环读取INI文件,当INI文件只有10行时,读到第10行就从重新从第一行读取。

范统.贾 发表于 2008-12-23 13:57:37

学习一下。

liongodmien 发表于 2008-12-24 15:14:44

if $path = '' then
$i = 1
continueloop
endif
页: [1]
查看完整版本: 如何循环读取INI文件