function MoveFile(const sName, dName: string): Boolean;{* 移动文件、目录,参数为源、目标名}
var
s1, s2: AnsiString;
lpFileOp: TSHFileOpStruct;
begin
s1 := PChar(sName) + #0#0;
s2 := PChar(dName) + #0#0;
with lpFileOp do
begin
Wnd := Application.Handle;
wFunc := FO_MOVE; //改成FO_COPY就是拷贝了
pFrom := PChar(s1);
pTo := PChar(s2);
fFlags := FOF_ALLOWUNDO;
hNameMappings := nil;
lpszProgressTitle := nil;
fAnyOperationsAborted := True;
end;
Result := SHFileOperation(lpFileOp) = 0;
end;