Mau konsultasi DELPHI
mungkin aja di bisa di bantu
Telp 62 813.1401.3305
/ 62 817. 910.8005

..<< More Info >>..

Tuesday, 15 January 2008

Delphi file manipulation

You can make forlder, remane forlder, delete forlder, checking folder by delphi command

File function in delphi :

  • checking file is exist or not :

    if FileExists( 'test.xls' )=false then
    showmessage ( "this file is not exist" ) ;

  • checking folder is exist or not :

    if directoryexists( xIsFolder ) then
    showmessage ( "this folder is not exist" ) ;

  • Close windows or program :

    var
    x6h : hwnd;
    begin

    x6h := findwindow(nil,"google - microsoft internet explorer"); // check windows / ie
    if x6h<>0 then postmessage ( x6h,wm_close,1,0); // close windows / ie

    end;
  • Delete file :

    sysutils.deletefile ( pchar('coba.xls') ) ;

  • Rename file :

    renamefile ( 'c:\temp\test1.XLS', 'c:\temp\test77.XLS' );

  • Openning file :

    first add in uses
    uses
    Windows, Messag . . . . . . . . . . . . . . . . . . , Dialogs, StdCtrls,
    shellapi ;

    begin
    shellexecute (handle,'open',pchar( 'c:\temp\text44.txt' ),nil,nil,sw_show) ;
    end;

  • To know the current drive in delphi :

    showmessage ( 'the current drive is ' + GetCurrentDir ) ;

Want to see all delphi command and function Click Here.

Delphi file manipulation

0 comments:

Digg!
Add to Technorati Favorites Join My Community at MyBloglog! Programming Blogs - Blog Catalog Blog Directory online counter
 

Bursa 2000 | Find Better Jobs