Цитата:
Цитата ZmeyRepack
как мне взять пути из Input для копирования »
|
Код:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#include <FileConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Program Files (x86)\koda_1.7.3.0\Forms\Form1.kxf
$Form1_1 = GUICreate("Form1", 532, 110, 192, 124)
$Button1 = GUICtrlCreateButton("Folder№1", 8, 8, 75, 25)
$Button2 = GUICtrlCreateButton("Folder№2", 8, 40, 75, 25)
$Input1 = GUICtrlCreateInput("", 88, 8, 433, 21)
$Input2 = GUICtrlCreateInput("", 88, 40, 433, 21)
$Button3 = GUICtrlCreateButton("Copy", 8, 72, 75, 25)
$Progress1 = GUICtrlCreateProgress(88, 72, 430, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$path = FileSelectFolder("Select source folder", "", $FSF_CREATEBUTTON + $FSF_NEWDIALOG + $FSF_EDITCONTROL, GUICtrlRead($Input1), $Form1_1)
If Not @error Then
GUICtrlSetData($Input1, $path)
EndIf
Case $Button2
$path = FileSelectFolder("Select destination folder", "", $FSF_CREATEBUTTON + $FSF_NEWDIALOG + $FSF_EDITCONTROL, GUICtrlRead($Input2), $Form1_1)
If Not @error Then
GUICtrlSetData($Input2, $path)
EndIf
Case $Button3
FileCopy(GUICtrlRead($Input1) & "\*.*", GUICtrlRead($Input2), $FC_OVERWRITE + $FC_CREATEPATH)
EndSwitch
WEnd
Цитата:
Цитата ZmeyRepack
и прикрутить к нему прогресс бар? »
|
Получить файлы из исходного каталога $Input1, посчитать их количество или занимаемый объём (в зависимости от того, что именно Вы собираетесь считать за 100%), затем перебирать в цикле, копируя по одному, одновременно обновляя ProgressBar.
|