-------------------- -------------------- -------------------- -------

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
__int64 size;__int64 freespace; int i;
DWORD Serial,
MaxLenFN,
FlagS;
char VolName[256],
FSName[100];
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
i=0; RichEdit1->Clear();
while(i<=DriveComboBox1->Items->Count-1)
{
Serial=0;
DriveComboBox1->ItemIndex=i;
AnsiString s=UpperCase(DriveComboBox1->Text.SubString(1,1))+":\\";
UINT DT;
DT=GetDriveType(s.c_str());
RichEdit1->Lines->Add("Äèñê:"+DriveComboBox1->Text);
size=DiskSize(DriveComboBox1->ItemIndex+2);
freespace=DiskFree(DriveComboBox1->ItemIndex+2);
if(GetVolumeInformation(s.c_str(), VolName, 255, &Serial, &MaxLenFN,
&FlagS, FSName, 255))
{
RichEdit1->Lines->Add("²ì'ÿ òîìó:"+String(VolName));
RichEdit1->Lines->Add ("Ôàéëîâà ñèñòåìà:" +String(FSName)+".Ñåð³éíèé íîìåð:"+String(Serial));
RichEdit1->Lines->Add("Ìàêñèìàëüíà äîâæèíà ³ìåí³ ôàéëà:"+String(MaxLenFN)+".Ïðàïîð:"+IntToStr(FlagS)+".Ñåð³éíèé íîìåð(64):"+IntToHex(__int64(Serial),8));
RichEdit1->Lines->Add("Ñåð³éíèé íîìåð âèäó ôîðìàòóâàííÿ #2:"+IntToHex(HIWORD(Serial),4)+"-"+IntToHex(LOWORD(Serial),4));
switch(DT){
case DRIVE_REMOVABLE:Label2->Caption="Äèñêîâîä ãíó÷êèõ äèñê³â"; break;
case DRIVE_FIXED:Label2->Caption="Äèñêîâèé ïðèñòð³é-â³í÷åñòåð"; break;
case DRIVE_REMOTE:Label2->Caption="³ääàëåíèé äèñê(ìåðåæíèé)"; break;
case DRIVE_CDROM:Label2->Caption="CD-ROM/DVD"; break;
case DRIVE_RAMDISK:Label2->Caption="RAM-äèñê"; break;
case1:Label2->Caption="Íåâèçíà÷åííî";
default:Label2->Caption="Ìîæëèâî ïîìèëêà!"; break;
}
RichEdit1->Lines->Add("Òèï äèñêà:"+Label2->Caption);
RichEdit1->Lines->Add ("Ïîâíèé îá'ºì:"+IntToStr(size/1024/1024));
RichEdit1->Lines->Add ("³ëüíî:"+IntToStr(freespace/1024/1024));
RichEdit1->Lines->Add ("Çàíÿòî:"+IntToStr((size-freespace)/1024/1024));
}
i=i++;
RichEdit1->Lines->Add("");
}
}
void__fastcall TForm1::BitBtn1Click(TObject*Sender)
{
if(SaveDialog1->Execute()){ RichEdit1->Lines->SaveToFile(SaveDialog1->FileName
//---------------------------------------------------------------------------