我想在Statusbar状态栏上显示磁盘的容量(比如c:盘的已用容量空间、未用容量空间和总的容量空间),请分别给出代码和标明注释说明,谢谢了!
解决方案 »
- 菜鸟提问:如何单击dbgrid中的一行后返回一个参数给sql语句,并将搜索结果返回给edit?
- 哪里有ShockwaveFlash控件??
- 寻找免费打印报表控件!
- 强烈要求FrameSniper版主马上辞去版主职位!!!!!!!
- 我想在mainform里面做一个背景图片,想问一下?
- 急!急!急!bcdtostr 怎么用100分
- 关于共用一个ADO Connection的小问题。请大家指点,在线等待。
- 怎样求得A1和A2(都是日期字段)相差的年、月、天数呢?
- 请教crystal reports 9.2字段内容都能显示,而用delphi7调用时只显示一个字段?
- sequoia速来拿分
- 如何获取登陆计算机后的用户名?
- 简单问题,来者有分!!!!!!!!!!!!!
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl,shellapi;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
DriveComboBox1: TDriveComboBox;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure DriveComboBox1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1; DriverNo:String;
FreeByte,TotalFreeByte,TotalByte:Int64;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
GetdiskFreeSpaceEx(Pchar(driverNo),PLARGEINTEGER(@freebyte)^,PLARGEINTEGER(@totalfreebyte)^,nil);
totalbyte:=freebyte+totalfreebyte;
edit1.Text :=inttostr(freebyte div 1024 div 1024 )+'MB';
edit2.Text :=inttostr(totalfreebyte div 1024 div 1024 )+'MB';
edit3.Text :=inttostr(totalbyte div 1024 div 1024 )+'MB';end;procedure TForm1.DriveComboBox1Change(Sender: TObject);
begin
DriverNo:=DriveComboBox1.Drive +':\';
end;end.
来获得容量等参数
在edit1.Text edit2.Text edit3.Text 显示