Ver Mensaje Individual
  #3  
Antiguo 17-05-2007
hperez hperez is offline
Miembro
 
Registrado: may 2007
Posts: 21
Reputación: 0
hperez Va por buen camino
Acabo de revisar algunos hilos y esta es la solucion mas practica

Código Delphi [-]
function GetVolumeID(DriveChar: Char): String;
 var
  MaxFileNameLength, VolFlags, SerNum: DWord;
 begin
  if GetVolumeInformation(PChar(DriveChar + ':\'), nil, 0,
     @SerNum, MaxFileNameLength, VolFlags, nil, 0)
  then
  begin
    Result := IntToHex(SerNum,20);
    Insert('-', Result, 5);
   // Result := IntToStr(SerNum);---si necesitan el decimal
  end
  else
      Result := '';
 end;
 procedure TFrmLogin.Button1Click(Sender: TObject);
 begin
    ShowMessage(GetVolumeID('C'));
 end;

Última edición por dec fecha: 17-05-2007 a las 01:33:29.
Responder Con Cita