Local $begin = TimerInit()
;~ $read = IniRead("initest.ini",1,99999,1)
$read=_MSDN_IniRead(@ScriptDir&"\initest.ini", "1", "99999")
Local $dif = TimerDiff($begin)
MsgBox(0,"时间差,这个计时的精度比sleep高",$dif&@CRLF&$read)
MsgBox(0,"读取内容",$read)
Func _MSDN_IniRead($hFile, $sSection, $sKey, $sDefault = "")
Local $tST = DllStructCreate("char[32767]")
Local $aGPPS = DllCall("Kernel32.dll", "int", "GetPrivateProfileString", _
"str", $sSection, "str", $sKey, "str", $sDefault, "ptr", DllStructGetPtr($tST), _
"dword", 32766, "str", $hFile)
If IsArray($aGPPS) = 0 Or $aGPPS[0] = 0 Then Return SetError(1, 0, $sDefault)
Return DllStructGetData($tST, 1)
EndFunc
|