Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #10  
Antiguo 18-07-2003
CRIS CRIS is offline
Miembro
 
Registrado: jul 2003
Posts: 63
Poder: 24
CRIS Va por buen camino
Hola, aqui pongo el codigo que yo hago para todo lo que necesito hacer, primero averiguo el numero de serie del hd despues le quito el signo (-) y despues lo convierto a decimal.
1.º El numero de serie es este 90A0-03FE
2.º Al quitarle el signo - se queda en 90A003FE
3.º Y al convertirlo me da -1868561410
¿que hago mal? aqui teneis el codigo.

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, StdCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
SpeedButton1: TSpeedButton;
Edit1: TEdit;
procedure FormActivate(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

Function QuitaMenos(S:String):String;
begin

while Pos('-', S) > 0 do
Delete(s,Pos('-', S),1);

Result:=S;
end;
function HexToInt(const Value: String): Integer;
begin
Result := StrToInt('$' + Value);
end;


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,8);
Insert('', Result, 5);
end
else
Result := '';
end;



{$R *.dfm}

procedure TForm1.FormActivate(Sender: TObject);
begin
Label1.Caption:=GetVolumeId('c');
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin

Label2.Caption:=IntToStr( HexToInt(label1.Caption) );


end;

end.


Salu2.CRIS.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 18:31:22.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi