euheny У меня нет готовой утилиты.
ViSiToR Цитата: Если не трудно, кинь сюда
Могу только тестовый кусочек.
[more=Демо]Global $f0, $f[2], $key[2], $value[2], $TempLine[2]
$text = ''
$f0 = FileOpen('Result.txt', 2)
Export('', 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion')
FileClose($f0)
MsgBox(0, 'Pass', $text)
$f[0] = FileOpen('Result.txt', 0)
$f[1] = FileOpen('Result2.txt', 0)
Compare()
FileClose($f[0])
FileClose($f[1])
Func Export($key0, $key1)
Local $i, $Temp, $Temp1
FileWriteLine($f0, '[' & StringLen($key0) & ']' & $key1)
; $text &= '[' & StringLen($key0) & ']' & $key & @CRLF
$i = 0
While 1
$i += 1
$Temp = RegEnumVal($key0 & $key1, $i)
If @error Then ExitLoop
$Temp1 = RegRead($key0 & $key1, $Temp)
FileWriteLine($f0, '"' & $Temp & '"=' & @extended & $Temp1)
WEnd
$i = 0
While 1
$i += 1
$Temp = RegEnumKey($key0 & $key1, $i)
If @error Then ExitLoop
Export($key0 & $key1 & '\', $Temp)
WEnd
Return
EndFunc ;==>Export
Func Read($n)
Local $Temp
$value[$n] = ''
While StringLeft($TempLine[$n], 1) <> '['
$TempLine[$n] = FileReadLine($f[$n])
If @error Then
$key[$n] = 'z'
Return
EndIf
WEnd
;MsgBox(0,$Temp,
$key[$n] = StringLeft($key[$n] & '\', Number(StringTrimLeft($TempLine[$n], 1))) & StringRightStr($TempLine[$n], ']')
$TempLine[$n] = FileReadLine($f[$n])
If @error Then Return
While $TempLine[$n] = '' Or StringLeft($TempLine[$n], 1) <> '['
If $TempLine[$n] <> '' Then $value[$n] &= $TempLine[$n] & @CRLF
$TempLine[$n] = FileReadLine($f[$n])
If @error Then Return
WEnd
; MsgBox(0, '*', $key[$n] & @CRLF & $value[$n])
Return
EndFunc ;==>Read
Func Compare()
Local $str1, $str2
$TempLine[0] = ''
$TempLine[1] = ''
Read(0)
Read(1)
While ($key[0] & $key[1]) <> 'zz'
; MsgBox(0,"**",$key[0] & @CRLF&$key[1])
Select
Case StringCompare($key[0], $key[1]) = 0
Read(0)
Read(1)
Case StringCompare($key[0], $key[1]) < 0
MsgBox(0, 'NewKey', $key[0] & @CRLF & $value[0])
Read(0)
; MsgBox(0,'',$str1 & @CRLF & $str2)
Case StringCompare($key[0], $key[1]) > 0
; MsgBox(0,'',$str1 & @CRLF & $str2)
MsgBox(0, 'DelKey', $key[1])
Read(1)
EndSelect
WEnd
EndFunc ;==>Compare
Func StringLeftStr($str, $sstr, $Flag = 1)
If StringInStr($str, $sstr, 0, $Flag) Then
Return StringLeft($str, StringInStr($str, $sstr, 0, $Flag) - 1)
EndIf
Return $str
EndFunc ;==>StringLeftStr
Func StringRightStr($str, $sstr, $Flag = 1)
If StringInStr($str, $sstr, 0, $Flag) Then
Return StringMid($str, StringInStr($str, $sstr, 0, $Flag) + StringLen($sstr))
EndIf
Return ''
EndFunc ;==>StringRightStr
[/more]