本帖最后由 afan 于 2010-8-8 11:46 编辑 #include <Array.au3>
$a = _IniReadSection_line_all('DOSNET.INF', 'FloppyFiles.1')
_ArrayDisplay($a, 'FloppyFiles.1')
$a = _IniReadSection_line_all('DOSNET.INF', 'FloppyFiles.3')
_ArrayDisplay($a, 'FloppyFiles.3')
Func _IniReadSection_line_all($iFile, $Section)
Local $s_File = FileRead($iFile), $line_all
Local $s_Sec = StringRegExp($s_File, '(?s)(?i)(?:^|\n)\h*\[\h*' & $Section & '\h*\](.+?)(?=\r\n\h*\[|$)', 3)
If @error Then Return SetError(1, 0, 0)
For $i = 0 To UBound($s_Sec) - 1
$line_all &= $s_Sec[$i]
Next
Local $s_line = StringRegExp($line_all, '\n\h*([^;\s].*?)\h*(?=\r?\n|$)', 3)
Return $s_line
EndFunc ;==>_IniReadSection_line_all
|