📄 unitpt.pas
字号:
unit UnitPT;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, ExtCtrls, StdCtrls, TeeProcs, TeEngine, Chart, Series;
type
TFrmPT = class(TForm)
Panel1: TPanel;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
Panel6: TPanel;
Panel7: TPanel;
Panel8: TPanel;
Panel9: TPanel;
Panel10: TPanel;
Panel11: TPanel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
StrGridPT: TStringGrid;
Panel12: TPanel;
Label15: TLabel;
ChartPT: TChart;
Series1: TPieSeries;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmPT: TFrmPT;
implementation
uses Myfunction, main;
{$R *.dfm}
procedure TFrmPT.FormShow(Sender: TObject);
const
i64MB=1000*1000;
//MAX_DRV=8;
var
i:integer;
TotalBytes:Int64;
begin
try
SearchDrivers();
except
showmessage('无法读取分区表!');
exit;
end;
StrGridPT.RowCount:=maxParts;
for i:=0 to maxParts-1 do
begin
StrGridPT.Cells[0,i]:=IntToStr(i);
StrGridPT.Cells[2,i]:=format('%.2x',[PartType[i]]);
case PartType[i] of
0 : StrGridPT.Cells[1,i]:='Unknow';
6 : StrGridPT.Cells[1,i]:='FAT16';
11: StrGridPT.Cells[1,i]:='FAT32';
end; // end of case
StrGridPT.Cells[3,i]:=IntToStr(btrack[i]);
StrGridPT.Cells[4,i]:=IntToStr(bhead[i]);
StrGridPT.Cells[5,i]:=IntToStr(bsector[i]);
StrGridPT.Cells[6,i]:=IntToStr(etrack[i]);
StrGridPT.Cells[7,i]:=IntToStr(ehead[i]);
StrGridPT.Cells[8,i]:=IntToStr(esector[i]);
TotalBytes:=DiskSize(i+3); //c:3 , d:4 , ....
StrGridPT.Cells[9,i]:=format('%.2f',[TotalBytes/i64MB ]);
case i of
0: ChartPT.Series[0].Add(TotalBytes,chr(i+ord('C')),clRed);
1: ChartPT.Series[0].Add(TotalBytes,chr(i+ord('C')),clYellow);
else
ChartPT.Series[0].Add(TotalBytes,chr(i+ord('C')),clfuchsia);
end; // end of case
end;// end of for
// end; // end of if
// showmessage(s);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -