Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.3.14.2
- Author: Anh DH
- Script Function:
- Template AutoIt script.
- #ce ----------------------------------------------------------------------------
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <File.au3>
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("Form1", 226, 131, 192, 124)
- $importAcc = GUICtrlCreateButton("Import", 16, 16, 75, 25)
- $tenFile = GUICtrlCreateInput("", 96, 16, 121, 21)
- $Create = GUICtrlCreateButton("Create", 16, 56, 195, 25)
- $Label1 = GUICtrlCreateLabel("Anh DH", 88, 96, 61, 24)
- GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $importAcc
- Importacc()
- Case $Create
- taofile()
- EndSwitch
- WEnd
- Func Importacc()
- Global $pathAcc = FileOpenDialog("Choose File Name",@ScriptDir & "\", "Text (*.txt)")
- Global $countLine = _FileCountLines($pathAcc)
- EndFunc
- Func ReadAcc()
- Global $fileopen = FileOpen($pathAcc)
- Global $readLine = FileReadLine($fileopen,$demName)
- $demName +=1
- EndFunc
- Func taofile()
- Local $fileName = GUICtrlRead($tenFile)
- FileOpen($tenfile , 1 )
- for $a = 1 to $countLine Step +1
- Call(ReadAcc())
- $data= Stringregexp($readLine , '\<Username\>(.*?)\<\/Username\>',3)
- FileWriteLine($fileName , $data)
- Next
- ;~ FileWriteLine($fileName , $data)
- FileClose($fileName)
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment