Função que não funciona com WIN98

09/08/2004

0

Estou usando esta função para capturar o serial do HD:

function TForm1.HDSerialNumber(FDrive: String): String;
var
Serial :DWord;
DirLen,Flags :DWord;
DLabel,SisArq : String ;
begin
Try
SetLength(DLabel,255);
SetLength(SisArq,255);
GetVolumeInformation(Pchar(FDrive+´:\´),Pchar(DLabel),255,@Serial,DirLen,Flags,Pchar(SisArq),255);
Result := IntToHex(Serial,8);
Except
Result :=´´;
end;
end;
O problema é o seguinte:
Qdo mapeio uma unidade de rede ou seja o c de outra máquina(WIN2000) pelo win98 ele não consegue pegar o nº serial da máquina mapeada. ALGUÉM JA TEVE ESTE PROBLEMA OU SABE COMO POSSO FAZER PARA QUE ELE CONSIGA PEGAR ESTE Nº SERIAL?


Foxcyber

Foxcyber

Responder

Posts

09/08/2004

P_lima

// Tenta isso, acho que resolve seu problema:
Var
Serial : DWord;
DirLen , Flags : DWord;
DLabel : Array[0..11] of Char;
Begin
Try
GetVolumeInformation(PChar(FDrive+´:\´), dlabel, 12, @Serial, DirLen, Flags, Nil, 0);
Result := IntToHex(Serial,8);
Except
Result := ´´;
End;
end;


Responder

Assista grátis a nossa aula inaugural

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar