It works, returning some useful information. Here is a ready to use
function for anyone interest:

// Get sys information:
// - 1 = Domain
// - 2 = Machine
// - 3 = Nodename
// - 4 = Release
// - 5 = Sysname
// - 6 = Version
function GetSysInfo( const WHAT_TO_RETURN: integer ): string;
var
   ResultStru: TUTSName;
   
begin
     Result := '';
     FpUname( ResultStru );
     case WHAT_TO_RETURN of
          1 : Result := ResultStru.Domain;
          2 : Result := ResultStru.Machine;
          3 : Result := ResultStru.Nodename;
          4 : Result := ResultStru.Release;
          5 : Result := ResultStru.Sysname;
          6 : Result := ResultStru.Version;
     end;
end;

Panagiotis


Στις 05-03-2006, ημέρα Κυρ, και ώρα 21:30 +0100, ο/η Michael Van Canneyt
έγραψε:
> 
> On Sun, 5 Mar 2006, Panagiotis Sidiropoulos wrote:
> 
> > Thanks a lot for information. Now I'm seeking for similar information
> > under Linux and MacOS. Any help would be most appreciated.
> 
> You can use the fpuname call for this on linux/darwin. 
> it's documented. (baseunix unit)
> 
> Michael.
> 
> > 
> > Panagiotis
> > 
> > Στις 05-03-2006, ημέρα Κυρ, και ώρα 18:09 +0100, ο/η Darius Blaszijk
> > έγραψε:
> > > There's no OS independent way to do this that I know of, but the getting 
> > > the
> > > OS version on win32 goes like this;
> > > 
> > > Darius
> > > 
> > > function GetWin32Version: string;
> > > var
> > >   verInfo: TOSVersionInfo;
> > >   WinVersion: string;
> > > begin
> > >   verInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
> > > 
> > >   if GetVersionEx(verInfo) then
> > >   begin
> > >     WinVersion := 'Unknown Windows version';
> > > 
> > >     if (verInfo.dwMajorVersion = 5) and (verInfo.dwMinorVersion = 2) then
> > >       WinVersion := 'Windows Server 2003';
> > >     if (verInfo.dwMajorVersion = 5) and (verInfo.dwMinorVersion = 1) then
> > >       WinVersion := 'Windows XP (2002)';
> > >     if (verInfo.dwMajorVersion = 5) and (verInfo.dwMinorVersion = 0) then
> > >       WinVersion := 'Windows 2000';
> > >     if (verInfo.dwMajorVersion = 4) and (verInfo.dwMinorVersion = 0) then
> > >       WinVersion := 'Windows NT';
> > >     if (verInfo.dwMajorVersion = 4) and (verInfo.dwMinorVersion > 0) then
> > >       WinVersion := 'Windows 95/98/ME';
> > > 
> > >     with verInfo do
> > >       Result := WinVersion + #13#10 +
> > >         Format('%d.%d (Build %d) %s',
> > >           [dwMajorVersion, dwMinorVersion, dwBuildNumber,
> > > string(verInfo.szCSDVersion)]);
> > >   end;
> > > end;
> > > 
> > > 
> > > ----- Original Message ----- 
> > > From: "Panagiotis Sidiropoulos" <[EMAIL PROTECTED]>
> > > To: <[email protected]>
> > > Sent: Sunday, March 05, 2006 7:27 PM
> > > Subject: [lazarus] System Information
> > > 
> > > 
> > > > I need to get information regarding system, such as user login name, OS
> > > > Version/Distribution, Hard drive serial number, etc. (OS indepented).
> > > >
> > > > Can anyone direct me where to find infomation and/or samples on this?
> > > >
> > > > Panagiotis
> > > >
> > > > _________________________________________________________________
> > > >      To unsubscribe: mail [EMAIL PROTECTED] with
> > > >                 "unsubscribe" as the Subject
> > > >    archives at http://www.lazarus.freepascal.org/mailarchives
> > > 
> > > _________________________________________________________________
> > >      To unsubscribe: mail [EMAIL PROTECTED] with
> > >                 "unsubscribe" as the Subject
> > >    archives at http://www.lazarus.freepascal.org/mailarchives
> > > 
> > 
> > _________________________________________________________________
> >      To unsubscribe: mail [EMAIL PROTECTED] with
> >                 "unsubscribe" as the Subject
> >    archives at http://www.lazarus.freepascal.org/mailarchives
> > 

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to