Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to read the hard disk serial number and volume label. Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Read the hard disk serial number and volume label 09-May-04
Category
Files Operation
Language
Delphi All Versions
Views
412
User Rating
7
# Votes
1
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   
2   unit Unit1;
3   
4   interface
5   
6   uses
7     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
8     Dialogs, StdCtrls;
9   
10  type
11    TForm1 = class(TForm)
12      Button2: TButton;
13      procedure Button2Click(Sender: TObject);
14    private
15      { Private declarations }
16    public
17    function GetHardDiskSerial(const DriveLetter: Char): string;
18      { Public declarations }
19    end;
20  
21  var
22    Form1: TForm1;
23  
24  implementation
25  
26  {$R *.dfm}
27  
28  function TForm1.GetHardDiskSerial(const DriveLetter: Char): string;
29  var 
30    NotUsed:     DWORD;
31    VolumeFlags: DWORD; 
32    VolumeInfo:  array[0..MAX_PATH] of Char; 
33    VolumeSerialNumber: DWORD;
34  begin 
35    GetVolumeInformation(PChar(DriveLetter + ':\'),
36      VolumeInfo, SizeOf(VolumeInfo), @VolumeSerialNumber, NotUsed,
37      VolumeFlags, nil, 0);
38    Result := Format('Label = %s   Volume Serial = %8.8X', [VolumeInfo, 
39  VolumeSerialNumber])
40  end;
41  
42  procedure TForm1.Button2Click(Sender: TObject);
43  begin
44  ShowMessage(GetHardDiskSerial('c'));
45  end;
46  
47  end.


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC