![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
|||
|
|||
|
Sigue sin funcionar
Tengo el suiguiente código Código:
If Reg.KeyExists('\Software\Microsoft\Windows\Bmnse') then
begin
If (Today > Reg.ReadDate('MyApp')) then
begin
Application.MessageBox('Mensaje','Atención',MB_OK+MB_IconError);
Halt;
end
else
Application.Run;
end
else
begin
Reg.CreateKey('\Software\Microsoft\Windows\Bmnse');
Reg.WriteDate('MyAppDate',StrToDate('15/03/04'));
Reg.WriteInteger('MyAppData',0);
If (Today > Reg.ReadDate('MyApp')) then
begin
Application.MessageBox('Mensaje','Atención',MB_OK+MB_IconError);
Halt;
end;
end
finally
Reg.Free;
end;
Código:
Reg.WriteDate('MyAppDate',StrToDate('15/03/04'));
Reg.WriteInteger('MyAppData',0);
A ver si así sale... Saludos. |
|
#2
|
|||
|
|||
|
Bueno, me lo he estado mirando (movido por la curiosidad) y he visto porque no te funciona. Te pego el código, pero te aconsejo te fijes en los errores que te da y en la ayuda
![]() Código:
procedure TForm1.Button1Click(Sender: TObject);
const
PathReg = '\Software\Microsoft\Windows\Bmnse';
var
Reg : TRegistry;
Today: TDate;
begin
Today := Date;
Reg := TRegistry.Create;
try
Reg.RootKey := HKey_Local_Machine;
If Reg.KeyExists(PathReg) then
begin
If (Today > Reg.ReadDate('MyAppDate')) then
begin
Application.MessageBox('Mensaje','Atención',MB_OK+MB_IconError);
Halt;
end
else
Application.Run;
end
else
begin
if not Reg.OpenKey(PathReg, true) then
begin
Application.MessageBox('Mensaje', 'Atención', MB_OK or MB_IconError);
Halt;
end;
Reg.WriteInteger('MyAppData', 0);
Reg.WriteDate('MyAppDate', EncodeDate(2004, 3, 15));
If (Today > Reg.ReadDate('MyAppDate')) then
begin
Application.MessageBox('Mensaje', 'Atención', MB_OK or MB_IconError);
Halt;
end;
end
finally
Reg.Free;
end;
end;
PD: a parte de eso, he hecho algún que otro cambio más ya que me parece algo más.... ¿correcto? Espero te sirva |
|
#3
|
|||
|
|||
|
Muchísimas gracias por la ayuda.
Te lo agradezco, de veras. Saludos. |
|
#4
|
|||
|
|||
|
You should change it..
in spanish is like gay. Best Regards Coollliam (L) |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
|