Ver Mensaje Individual
  #5  
Antiguo 05-05-2007
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Reputación: 20
cHackAll Va por buen camino
Cool Creo yo...

La forma mas sencilla que tendrás es leer del Environment (variables de entorno) la variable "USERNAME", lo conseguirás con la API 'GetEnvironmentVariable'.

Por si no está del todo claro, Ejecutas cmd, y escribes "echo %USERNAME%"

ó

Código Delphi [-]
 
procedure TForm1.Button1Click(Sender: TObject);
var Buffer: array [0..31] of Char;
begin
 GetEnvironmentVariable('USERNAME', @Buffer, SizeOf(Buffer));
 Caption := Buffer
end;

Suerte!
Responder Con Cita