TERMINAL,
Или так:
Код:
#include <GUIConstantsEx.au3>
$j = 0
$sFile = @ScriptDir & '\Default.rdp'
If Not FileExists($sFile) Then
MsgBox(16, 'Error', 'Error')
Exit
EndIf
$iEncoding = FileGetEncoding($sFile)
$hFile = FileOpen($sFile, $iEncoding)
$sText = FileRead($hFile)
FileClose($hFile)
$aTemp = StringSplit(StringStripCR($sText), @LF)
Dim $aText[$aTemp[0] + 1][4]
For $i = 1 To $aTemp[0]
If $aTemp[$i] Then
$j += 1
$aText[$i][1] = StringRegExpReplace($aTemp[$i], '^(.*?):.*', '\1')
$aText[$i][2] = StringRegExpReplace($aTemp[$i], $aText[$i][1] & '(:.*?:).*', '\1')
$aText[$i][3] = StringRegExpReplace($aTemp[$i], $aText[$i][1] & $aText[$i][2] & '(.*?)\z', '\1')
EndIf
Next
ReDim $aText[$j + 1][4]
$aText[0][0] = $j
$aTemp = 0
$sText = ''
$j = 0
$hGui = GUICreate('Редактор Default.rdp', 260, 30 + $aText[0][0] * 15)
For $i = 1 To $aText[0][0]
GUICtrlCreateLabel($aText[$i][1], 10, 5 + ($i - 1) * 15, 130, 14)
GUICtrlSetFont(-1, 7)
$aText[$i][0] = GUICtrlCreateInput($aText[$i][3], 150, 5 + ($i - 1) * 15, 100, 14)
GUICtrlSetFont(-1, 7)
Next
$nButton = GUICtrlCreateButton('Сохранить', 80, 7 + $aText[0][0] * 15, 100, 20)
GUICtrlSetState(-1, $GUI_FOCUS)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $nButton
$sText = ''
For $i = 1 To $aText[0][0]
$sText &= $aText[$i][1] & $aText[$i][2] & GUICtrlRead($aText[$i][0]) & @CRLF
Next
$hFile = FileOpen($sFile, $iEncoding + 2)
FileWrite($hFile, $sText)
FileClose($hFile)
EndSwitch
WEnd