Arsip: Copy, move, delete and rename files


by saysansay in Articles more 13 years ago 2536
Mumpung nga ada kerjaan, Tak isi artikel Uda lama nga nyotor ama Mas Ulil. Artikel ini menjelaskan Suatu Fungsi untuk Copy, move, delete and rename files..Yang dapat diimplementasikan kedalam delphi...ya...mudah2an aja bermanfaat Bagi...yang suka coding2an dan yg suka Inovasi...coba dech..diimplementasikan ke Delphi...wakakakakakakakakakakakaka Never give erorr
Copy File Nech..Functionnya wakakakakaka
Function scShellCopyFile(FormHandle : THandle; StrFrom, StrTo : string;
BlnSilent : Boolean = False) : Boolean;
var
F : TShFileOpStruct;
begin
F.Wnd:=FormHandle;
F.wFunc:=FO_COPY;
F.pFrom:=PChar(StrFrom+#0);
F.pTo:=PChar(StrTo+#0);
F.fFlags := FOF_ALLOWUNDO or FOF_RENAMEONCOLLISION;
if BlnSilent then
F.fFlags := F.fFlags or FOF_SILENT;
if ShFileOperation(F) <> 0 then
result:=False
else
result:=True;
end;
Syntax Highlighted with https://pascal-id.org/syntax


Move File Oiiii asyik Functionnya wakakakakaka
Function scShellMoveFile(FormHandle : THandle; StrFrom, StrTo : string;
BlnSilent : Boolean = False) : Boolean;
var
F : TShFileOpStruct;
begin
F.Wnd:=FormHandle;
F.wFunc:=FO_MOVE;
F.pFrom:=PChar(StrFrom+#0);
F.pTo:=PChar(StrTo+#0);
F.fFlags := FOF_ALLOWUNDO or FOF_RENAMEONCOLLISION;
if BlnSilent then
F.fFlags := F.fFlags or FOF_SILENT;
if ShFileOperation(F) <> 0 then
result:=False
else
result:=True;
end;
Syntax Highlighted with https://pascal-id.org/syntax


Klu yang Ini Delete Filenya wakakaka asyik banget pa lagi delete File punya mas Ulil
Function scShellDeleteFile(FormHandle : THandle; StrFile : String; BlnSilent :
Boolean = False;BlnConfirmation : Boolean = True; BlnUndo : Boolean = True) : Boolean;
var
F : TShFileOpStruct;
begin
F.Wnd:=FormHandle;
F.wFunc:=FO_DELETE;
F.pFrom:=PChar(StrFile+#0);
if BlnUndo then
F.fFlags := FOF_ALLOWUNDO;
if not BlnConfirmation then
F.fFlags := FOF_NOCONFIRMATION;
if BlnSilent then
F.fFlags := F.fFlags or FOF_SILENT;
if ShFileOperation(F) <> 0 then
result:=False
else
result:=True;
end;
Syntax Highlighted with https://pascal-id.org/syntax


Rename file Klu perlu mas Ulil tak rename Juga wakakakakakakak
function scShellRenameFile(FormHandle : THandle; StrFrom, StrTo : string;
BlnSilent : Boolean = False) : Boolean;
var
F : TShFileOpStruct;
begin
F.Wnd:=FormHandle;
F.wFunc:=FO_RENAME;
F.pFrom:=PChar(StrFrom+#0);
F.pTo:=PChar(StrTo+#0);
F.fFlags := FOF_ALLOWUNDO or FOF_RENAMEONCOLLISION;
if BlnSilent then
F.fFlags := F.fFlags or FOF_SILENT;
if ShFileOperation(F) <> 0 then
result:=False
else
result:=True;
end;
Syntax Highlighted with https://pascal-id.org/syntax
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com