October 2009
M T W T F S S
    Nov »
 1234
567891011
12131415161718
19202122232425
262728293031  

Archives

Categories

  • [+]ASP.NET (7) 
  • [+]C# (87) 
  • [+]C++ (13) 
  • [—]Delphi (20) 
  • [+]JavaScript (24) 
  • [+]Regular Expressions (7) 
  • [+]SQL (13) 
  • [+]VB (100) 
  • [+]VB.NET (4) 

Online

Users: 7 Guests, 2 Bots
  • Loading...


    Loading...

    Login






    Register | Lost password?

    Register





    A password will be mailed to you.
    Log in | Lost password?

    Retrieve password





    A confirmation mail will be sent to your e-mail address.
    Log in | Register
  • Show Systems Disk Space

    Author: Ali Ebrahimi

    URL: http://www.delphi3000.com/articles/article_4533.asp?SK=

    // Ali Ebrahimi (ebr_ali@yahoo.com)
    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;
    
    type
      TForm1 = class(TForm)
        Button1: TButton;
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        ComboBox1: TComboBox;
        procedure FormCreate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
      Free1,free2,Total1:Int64;
    
    begin
    
      GetDiskFreeSpaceEx(pchar(ComboBox1.Text)  , free1 , total1 , @free2);
      Label1.Caption := 'Capacity : ' + IntToStr(Total1) + ' Byte     '+ floatToStr(Total1 div (1024*1024)) + ' MB';
      Label2.Caption := 'Free space : ' + IntToStr(Free1) + ' Byte     '+ floatToStr(Free1 div (1024*1024)) + ' MB';
      Label3.Caption := 'Used space : ' + IntToStr(Total1-Free1) + ' Byte     '+ floatToStr((Total1-Free1) div (1024*1024)) + ' MB';
    
    end;
    
    procedure TForm1.FormCreate(Sender: TObject);
    var
      i:Integer;
    begin
      for i:=Ord('A') to Ord('Z') do
        begin
          if  GetDriveType(pchar(char(i)+':\'))=3  then
            ComboBox1.Items.Add(char(i)+':\');
          end;
      ComboBox1.Text:=ComboBox1.Items.Strings[0];
    end;
    
    end.
    

    Share: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • Digg
    • del.icio.us
    • Bloglines
    • Facebook
    • Google Bookmarks
    • LinkedIn
    • Technorati
    • TwitThis
    • Webnews

    Leave a Reply

     

     

     

    You can use these HTML tags

    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <font color="" face="" size=""> <span style="">

    Spam Protection by WP-SpamFree Plugin