TJvComputerInfoEx retrieve harddisk id

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

TJvComputerInfoEx retrieve harddisk id

Mesaj gönderen mia »

i am using TJvComputerInfoEx i able to retrieve many info of computer as os version and folders location but iam trying to get the hard disk id

using JvComputerInfoEx.VolumeSerialNumber[] , what i have to call in const Drive ?

to be more specific i know that i have to put a volume letter but what if different computer dont have the same volume letter as example

volumeserialnumber['C'] or E OR H OR F OR G
En son mia tarafından 23 Kas 2015 05:18 tarihinde düzenlendi, toplamda 1 kere düzenlendi.
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4741
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: TJvComputerInfoEx retrieve harddisk id

Mesaj gönderen mrmarman »

in the normal case windows installed drive.
- If you want this for an operation like license check, copy protection ext. , you also must be know that where the user runs your project? Local computer or remote network like \\miacomputer\project.exe...
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TJvComputerInfoEx retrieve harddisk id

Mesaj gönderen mia »

yes this is my point what if pc dont have C drive or the Drive string that i set into application for example

what if VolumeSerialNumber['C'] does not exist on other computer can i detect the current drive i know that i can use

GetCurrentDir[1]; but in my project i want to get all drives together

if there is drive called C OR E OR F OR what ever etc..
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4741
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: TJvComputerInfoEx retrieve harddisk id

Mesaj gönderen mrmarman »

I usually use the users own windows installed drive letter to look for.

Kod: Tümünü seç

Var
  Dir: array [0..MAX_PATH] of Char;
  WindowsDrive : Char;
begin
  GetWindowsDirectory(dir, MAX_PATH);
  WindowsDrive := Dir[0]; // array begins at index (0)
  ShowMessage( WindowsDrive );
end;
This code gives you Windows installed drive letter
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TJvComputerInfoEx retrieve harddisk id

Mesaj gönderen mia »

thats helps alot thank you very much mrmarman
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TJvComputerInfoEx retrieve harddisk id

Mesaj gönderen mia »

i worked on a way to get all list drives on pc

Kod: Tümünü seç

procedure GetDriveLetters(Stringlist:TStringList);// grab drive list
var
  vDrivesSize: Cardinal;
  vDrives	: array[0..128] of Char;
  vDrive	 : PChar;
begin
 Stringlist.Clear;
	vDrivesSize := GetLogicalDriveStrings(SizeOf(vDrives), vDrives);
	if vDrivesSize=0 then Exit;
	vDrive := vDrives;
	while vDrive^ <> #0 do
	begin
	  Stringlist.Add(StrPas(vDrive));
	  Inc(vDrive, SizeOf(vDrive));
	end;
end;

Kod: Tümünü seç

//parse list
var
Gstring : Tstringlist;
I : integer;
Driveslist : string;
begin

Gstring := Tstringlist.Create;
GetDriveLetters(Gstring);
try
Driveslist := StringReplace(Gstring.Text, ':\', '', [rfReplaceAll, rfIgnoreCase]);
finally
Gstring.Free;
end;
i wanted now to use JvComputerInfoEx.Identification.VolumeSerialNumber[Founded drive list as example c + d + f] to get there volium serial like

C5KIM-557-GHMo-1154 etc ... for clear example

Kod: Tümünü seç

JvComputerInfoEx.Identification.VolumeSerialNumber[DriveC]  + '-' + JvComputerInfoEx.Identification.VolumeSerialNumber['E']
but with drives list inside Driveslist variable
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4741
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: TJvComputerInfoEx retrieve harddisk id

Mesaj gönderen mrmarman »

so, I don't understand what the problem is ?
Driveslist owns the whole drives letter. The rest of that a basic loop inside Driveslist variable.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TJvComputerInfoEx retrieve harddisk id

Mesaj gönderen mia »

i found that no need to grab many drives garbing drive that install windows is enough .
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4741
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: TJvComputerInfoEx retrieve harddisk id

Mesaj gönderen mrmarman »

That was the point which my first message.
Resim
Resim ....Resim
Cevapla