回复 4# austere For $i = 1 To $FileList[0]
For $s = 1 To $UpList[0]
Dim $UpList2 = _Menu($UpList[$s])
If _ArraySearch($UpList2,$FileList[$i]) <> -1 Then
Dim $FileList2 = _Menu($File_Dir & "" & $FileList[$i])
For $n = 1 To $FileList2[0]
_GUICtrlEdit_AppendText($Edit, "移动 " & $FileList[$i] & " - "& $FileList2[$n])
FileWrite($log,$FileList[$i] & "-"& $FileList2[$n])
If FileMove($File_Dir & "" & $FileList[$i] & "" & $FileList2[$n],$UpList[$s] & "" & $FileList[$i] & "" & $FileList2[$n]) = 0 Then
_GUICtrlEdit_AppendText($Edit, " *未完成*" & @CRLF)
FileWrite($log," 【未完成】" & @CRLF)
Else
FileMove($File_Dir & "" & $FileList[$i] & "" & $FileList2[$n],$UpList[$s] & "" & $FileList[$i] & "" & $FileList2[$n])
Dim $sum = _Menu($UpList[$s] & "" & $FileList[$i])
_GUICtrlEdit_AppendText($Edit, " (总:" & $sum[0] - 2 & ")" & @CRLF)
FileWrite($log," -> " & $UpList[$s] & "" & $FileList[$i] & @CRLF)
$size2 = DirGetSize($File_Dir)
GUICtrlSetData($Progress1,StringFormat("%d",$size1 - $size2)/$size1*100)
EndIf
Next
EndIf
DirRemove($File_Dir &""& $FileList[$i])
Next
代码有点复杂,这是一部分 , 卡的应该就是ELSE后面, FileMove($File_Dir & "\" & $FileList[$i] & "\" & $FileList2[$n],$UpList[$s] & "\" & $FileList[$i] & "\" & $FileList2[$n]) 这一句,各种List[].是移动之前,对文件名和文件夹名字的处理,在另外的func里面完成的。
其实就是个简单的 FileMove(“A”,“B”)而已。 意思就是用filemove 移动超过700M左右的文件,会卡死。对了,是有UI的。我写个简单点的 ,你试试吧。#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("窗体1", 238, 307, 314, 226)
$Button1 = GUICtrlCreateButton("FileMove", 48, 24, 153, 57)
$Group1 = GUICtrlCreateGroup("tips", 8, 112, 217, 185)
$Edit1 = GUICtrlCreateEdit("", 16, 136, 201, 153, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_HSCROLL))
GUICtrlSetData(-1, "Edit1")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_GUICtrlEdit_AppendText($Edit1, "正在移动...")
FileMove("d:\A.mp4","e:\A.mp4")
_GUICtrlEdit_AppendText($Edit1, "w完成")
EndSwitch
WEnd
把 A路径 换成一个上G 的大文件,至少7~800M 。试试 |