anhdh

Untitled

Jun 8th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.66 KB | None | 0 0
  1. #cs ----------------------------------------------------------------------------
  2.  
  3.  AutoIt Version: 3.3.14.2
  4.  Author:         Anh DH
  5.  
  6.  Script Function:
  7.     Template AutoIt script.
  8.  
  9. #ce ----------------------------------------------------------------------------
  10.  
  11. #include <ButtonConstants.au3>
  12. #include <EditConstants.au3>
  13. #include <GUIConstantsEx.au3>
  14. #include <StaticConstants.au3>
  15. #include <WindowsConstants.au3>
  16. #include <File.au3>
  17.  
  18. #Region ### START Koda GUI section ### Form=
  19. $Form1 = GUICreate("Form1", 226, 131, 192, 124)
  20. $importAcc = GUICtrlCreateButton("Import", 16, 16, 75, 25)
  21. $tenFile = GUICtrlCreateInput("", 96, 16, 121, 21)
  22. $Create = GUICtrlCreateButton("Create", 16, 56, 195, 25)
  23. $Label1 = GUICtrlCreateLabel("Anh DH", 88, 96, 61, 24)
  24. GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
  25. GUISetState(@SW_SHOW)
  26. #EndRegion ### END Koda GUI section ###
  27.  
  28. While 1
  29.     $nMsg = GUIGetMsg()
  30.     Switch $nMsg
  31.         Case $GUI_EVENT_CLOSE
  32.             Exit
  33.          Case $importAcc
  34.             Importacc()
  35.          Case $Create
  36.             taofile()
  37.     EndSwitch
  38.  WEnd
  39.  
  40. Func Importacc()
  41.     Global $pathAcc = FileOpenDialog("Choose File Name",@ScriptDir & "\", "Text (*.txt)")
  42.     Global $countLine = _FileCountLines($pathAcc)
  43.  EndFunc
  44.  
  45. Func ReadAcc()
  46.     Global $fileopen = FileOpen($pathAcc)
  47.     Global $readLine = FileReadLine($fileopen,$demName)
  48.     $demName +=1
  49.  EndFunc
  50.  
  51.  
  52. Func taofile()
  53.    Local $fileName = GUICtrlRead($tenFile)
  54.     FileOpen($tenfile , 1 )
  55.     for $a = 1 to $countLine Step +1
  56.        Call(ReadAcc())
  57.        $data= Stringregexp($readLine , '\<Username\>(.*?)\<\/Username\>',3)
  58.        FileWriteLine($fileName , $data)
  59.  
  60.  
  61.    Next
  62. ;~  FileWriteLine($fileName , $data)
  63.    FileClose($fileName)
  64. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment