[C] 纯文本查看 复制代码
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_UseX64=n
#PRE_Res_requestedExecutionLevel=None
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
;~ #include <bug.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <Array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("文件提取器", 272, 442, 150, 120)
$Label1 = GUICtrlCreateLabel("后缀名:", 30, 20, 50, 25)
$Input1 = GUICtrlCreateInput("txt", 96, 15, 80, 25)
$Label2 = GUICtrlCreateLabel("文件路径:", 30, 55, 100, 25)
$Input2 = GUICtrlCreateInput("C:\Users\niqindong\Desktop\test", 96, 47, 150, 25)
$Label3 = GUICtrlCreateLabel("目标路径:", 30, 85, 100, 25)
$Input3 = GUICtrlCreateInput("C:\Users\niqindong\Desktop\test1", 96, 77, 150, 25)
$Edit1 = GUICtrlCreateEdit("", 24, 112, 220, 250)
$btn1 = GUICtrlCreateButton("读取", 30, 390, 50, 30)
$btn2 = GUICtrlCreateButton("提取", 110, 390, 50, 30)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $btn1
_duqu()
Case $btn2
_tiqu()
EndSwitch
WEnd
Func _duqu()
Local $FilePath = GUICtrlRead($Input2)
If StringRight($FilePath, 1) = "\" Then
Else
$FilePath = $FilePath & "\"
EndIf
Local $FileList = _FileListToArray($FilePath, "*." & GUICtrlRead($Input1), 1)
;~ _ArrayDisplay($FileList)
GUICtrlSetData($Edit1, "")
For $i = 1 To UBound($FileList) - 1
GUICtrlSetData($Edit1, GUICtrlRead($Edit1) & $FileList[$i] & @CRLF)
Next
EndFunc ;==>_duqu
Func _tiqu()
Local $FilePath = GUICtrlRead($Input2)
Local $mubiaoPath = GUICtrlRead($Input3)
If StringRight($FilePath, 1) = "\" Then
Else
$FilePath = $FilePath & "\"
EndIf
Local $FileList = _FileListToArray($FilePath, "*." & GUICtrlRead($Input1), 1)
For $i = 1 To UBound($FileList) - 1
FileMove($FilePath & $FileList[$i], $mubiaoPath)
Next
EndFunc ;==>_tiqu