delphi获得电脑登陆名
Function GetLocalName:String; Var UserName : PChar; Size : Dword; Begin Getmem(UserName ,255); Size:=255; if Windows.GetUserName(UserName,Size) = False then begin Freemem(UserName); GetLocalName := ''; Exit; end; GetLocalName := UserName ; Freemem(UserName);