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
  #4  
Antiguo 01-05-2004
CRIS CRIS is offline
Miembro
 
Registrado: jul 2003
Posts: 63
Poder: 23
CRIS Va por buen camino
Hola aqui tienes para averiguar el numero de serie del disco duro, ya te queda menos jejeje.Salu2.CRIS.

unit Unit1;

interface

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

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

var
Form1: TForm1;

implementation
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.SpeedButton1Click(Sender: TObject);
begin
Label1.Caption:=GetVolumeId('c');

end;

end.

y de esta forma te dara los datos del disco duro en decimal:
------------------------------------------------

unit Unit1;

interface

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

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

var
Form1: TForm1;

implementation
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 := IntToStr(SerNum);
end
else
Result := '';
end;
{$R *.dfm}

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

end;

end.
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 10:12:24.


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