::: µ¨ÆÄÀÌ Tip&Trick :::

µ¨ÆÄÀÌ Tip&Trick ¼º°Ý¿¡ ¸ÂÁö ¾Ê´Â ±¤°í,ºñ¹æ,Áú¹®ÀÇ ±ÛÀº Áï½Ã »èÁ¦Çϸç
³»¿ëÀ» º¹»çÇÏ¿© »ç¿ëÇÒ °æ¿ì ¹Ýµå½Ã ÀÌ°÷(http://www.howto.pe.kr)À» Ãâó·Î ¸í½ÃÇÏ¿© ÁÖ¼¼¿ä


Category

  ±è¿µ´ë(2003-03-06 21:00:18, Hit : 7878, Vote : 1369
 ½Ã½ºÅÛÀÇ °¢Á¾ Á¤º¸

// ÀÛ¼ºÀÚ: Â÷Á¤ÈÆ (whiteowl@hanmail.net)

unit GetInfo;

interface

uses
Windows, Messages, SysUtils, Classes, Registry;

type
SystemInfoRecord = record
   VolumeName,                     // µð½ºÅ© º¼·ý¸í
   VolumeSerial,                   // µð½ºÅ© ½Ã¸®¾ó¹øÈ£
   FileSystemName,                 // ÆÄÀϱ¸Á¶
   Drives            : shortstring;// µð½ºÅ©¸íµé
   ProcessorType     : shortstring;// CPU ŸÀÔ(MMX³ª P-II´Â ¾ÈµÊ)
   Version,                        // À©µµ¿ì ¹öÀü
   Plattform         : shortstring;// À©µµ¿ì Á¾·ù
   PlattId           : DWORD;      // Çö Ç÷§Æû ID
   ComputerName,                   // ÄÄÇ»ÅÍ À̸§
   FPU,                            // FPU À¯¹«
   UserName,                       // »ç¿ëÀÚ À̸§
   CompanyName,                    // ȸ»çÀ̸§
   CDSerial          : shortstring;// À©µµ¿ì ½Ãµð ½Ã¸®¾ó¹øÈ£
   TotalPhys,                      // ÃÑ ¸Þ¸ð¸®
   AvailPhys,                      // ÀÌ¿ëÇÒ ¼ö ÀÖ´Â ¸Þ¸ð¸®
   TotalVirtual,                   // ÃÑ °¡»ó¸Þ¸ð¸®
   AvailVirtual,                   // ÀÌ¿ëÇÒ ¼ö ÀÖ´Â °¡»ó¸Þ¸ð¸®
   MemoryLoad        : DWORD;      // ¸Þ¸ð¸® ÀûÀçÀ²
   BiosDate,                       // ¸¶´õº¸´õÀÇ ¹ÙÀÌ¿À½º ³¯Â¥
   BiosName,                       // ¸¶´õº¸´õÀÇ ¹ÙÀÌ¿À½º À̸§
   BiosVer,                        // ¸¶´õº¸´õÀÇ ¹ÙÀÌ¿À½º ¹öÀü
   BusType,                        // ¹ö½ºÅ¸ÀÔ
   CPU,                            // ¹ÙÀÌ¿À½º¿¡ ³ªÅ¸³­ CPUÁ¾·ù
   MachineType       : shortstring;// ¹ÙÀÌ¿À½º¿¡ ³ªÅ¸³­ ÄÄÁ¾·ù
end;

var
SysInfoRec: SystemInfoRecord;

function  GetAllSystemInfo: SystemInfoRecord; stdcall;

implementation

var
OSVerInfo: TOSVersionInfo;

function GetRegStr(Key, St: string): string;
begin
   with TRegistry.Create do
   try
     RootKey := HKEY_LOCAL_MACHINE;
     if OpenKey(Key, False) then result := ReadString(St);
   finally
     Free;
   end;
end;

procedure GetComputerName;
var
  Computer : PChar;
  CSize    : DWORD;
begin
  CSize := MAX_COMPUTERNAME_LENGTH + 1;
  try
     GetMem( Computer, CSize );
     if Windows.GetComputerName( Computer, CSize ) then
        SysInfoRec.ComputerName := Computer;
  finally
     FreeMem( Computer );
  end;
end;

procedure GetVolumeInfo;
var
  lpRootPathName           : PChar;
  lpVolumeNameBuffer       : PChar;
  nVolumeNameSize          : DWORD;
  lpVolumeSerialNumber     : DWORD;
  lpMaximumComponentLength : DWORD;
  lpFileSystemFlags        : DWORD;
  lpFileSystemNameBuffer   : PChar;
  nFileSystemNameSize      : DWORD;
begin
  try
     GetMem( lpVolumeNameBuffer, MAX_PATH + 1 );
     GetMem( lpFileSystemNameBuffer, MAX_PATH + 1 );

     nVolumeNameSize := MAX_PATH + 1;
     nFileSystemNameSize := MAX_PATH + 1;

     lpRootPathName := PChar( 'C:' );
     if Windows.GetVolumeInformation( lpRootPathName,
                                      lpVolumeNameBuffer,
                                      nVolumeNameSize,
                                      @lpVolumeSerialNumber,
                                      lpMaximumComponentLength,
                                      lpFileSystemFlags,
                                      lpFileSystemNameBuffer,
                                      nFileSystemNameSize ) then
     begin
       with SysInfoRec do begin
         VolumeName         := lpVolumeNameBuffer;
         VolumeSerial       := IntToHex(HiWord(lpVolumeSerialNumber), 4) + '-' +
                 IntToHex(LoWord(lpVolumeSerialNumber), 4);
         FileSystemName     := lpFileSystemNameBuffer;
       end;
     end;
  finally
     FreeMem( lpVolumeNameBuffer );
     FreeMem( lpFileSystemNameBuffer );
  end;
end;

procedure GetOSVersionInfo;

function Plat(Pl: DWORD): string;
begin
   case Pl of
     VER_PLATFORM_WIN32s:        result := 'Windows 3.1';
     VER_PLATFORM_WIN32_WINDOWS: result := 'Windows 95';
     VER_PLATFORM_WIN32_NT:      result := 'Windows NT';
     else                        result := '???';
   end;
end;

begin

with OSVerInfo, SysInfoRec do begin
   dwOSVersionInfoSize := SizeOf(OSVerInfo);
   if GetVersionEx(OSVerInfo) then;
   Version := Format('%d.%d (%d.%s)',[dwMajorVersion, dwMinorVersion,
                                     (dwBuildNumber and $FFFF), szCSDVersion]);
   Plattform := Plat(dwPlatformId);
   PlattID   := dwPlatformId;
end;
end;

procedure GetDriveNames;
var
  D1   : set of 0..25;
  D2   : integer;
begin
  DWORD( D1 ) := Windows.GetLogicalDrives;
  with SysInfoRec do begin
    Drives := '';
    for D2 := 0 to 25 do
       if D2 in D1 then
          Drives := Drives + Chr( D2 + Ord( 'A' )) + ': ';
  end;
end;

procedure GetSystemInfo;
var TmpStr: string;
   MProc: string;
   LocalSI: TSystemInfo;
const
  PROCESSOR_INTEL_386     = 386;
  PROCESSOR_INTEL_486     = 486;
  PROCESSOR_INTEL_PENTIUM = 586;
  PROCESSOR_MIPS_R4000    = 4000;
  PROCESSOR_ALPHA_21064   = 21064;
begin
Windows.GetSystemInfo(LocalSI);

with LocalSI, SysInfoRec do begin
   case dwProcessorType of
      PROCESSOR_INTEL_386      : ProcessorType := ' 386';
      PROCESSOR_INTEL_486      : ProcessorType := ' 486';
      PROCESSOR_INTEL_PENTIUM  : ProcessorType := ' Pentium';
      PROCESSOR_MIPS_R4000     : ProcessorType := ' MIPS';
      PROCESSOR_ALPHA_21064    : ProcessorType := ' ALPHA';
   end;
end;
end;

procedure MemoryInfo;
var
  MemStatus: TMemoryStatus;
begin
MemStatus.dwLength := SizeOf(MemStatus);
GlobalMemoryStatus(MemStatus);
with SysInfoRec do begin
   TotalPhys    := MemStatus.dwTotalPhys DIV 1024;
   AvailPhys    := MemStatus.dwAvailPhys DIV 1024;
   TotalVirtual := MemStatus.dwTotalVirtual DIV 1024;
   AvailVirtual := MemStatus.dwAvailVirtual DIV 1024;
   MemoryLoad   := MemStatus.dwMemoryLoad;
end;
end;

procedure GetRegisterInfo;
const
FPPKey = 'hardwareDESCRIPTIONSystemFloatingPointProcessor';
var
CurVerKey : PChar;
begin
with SysInfoRec do begin
   case PlattID of
     VER_PLATFORM_WIN32_WINDOWS :
           CurVerKey := 'SOFTWAREMicrosoftWindowsCurrentVersion';
     VER_PLATFORM_WIN32_NT      :
           CurVerKey := 'SOFTWAREMicrosoftWindows NTCurrentVersion';
     else  CurVerKey := nil;
   end;

   with TRegistry.Create do
   try
       RootKey := HKEY_LOCAL_MACHINE;
       if OpenKey(FPPKey, False) then
          FPU :=  'Yes'
       else FPU :=  'No';
   finally
     Free;
   end;

   UserName := GetRegStr(CurVerKey,'RegisteredOwner');
   CompanyName := GetRegStr(CurVerKey,'RegisteredOrganization');
   if PlattID = VER_PLATFORM_WIN32_WINDOWS then
      CDSerial :=  GetRegStr(CurVerKey,'ProductID');

end;
end;

procedure GetBiosInfo;
begin
with SysInfoRec do begin
   BiosDate    := GetRegStr('EnumRoot*PNP0C01000','BIOSDate');
   BiosName    := GetRegStr('EnumRoot*PNP0C01000','BIOSName');
   BiosVer     := GetRegStr('EnumRoot*PNP0C01000','BIOSVersion');
   BusType     := GetRegStr('EnumRoot*PNP0C01000','BusType');
   CPU         := GetRegStr('EnumRoot*PNP0C01000','CPU');
   MachineType := GetRegStr('EnumRoot*PNP0C01000','MachineType');
end;
end;

function GetAllSystemInfo: SystemInfoRecord; stdcall;
begin
GetOSVersionInfo;
GetOSVersionInfo;
GetDriveNames;
GetSystemInfo;
GetVolumeInfo;
GetComputerName;
MemoryInfo;
GetRegisterInfo;
GetBiosInfo;
result := SysInfoRec;
end;

end.





691   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ListView ÀÇ Ä÷³º°·Î Sort (³»¸²Â÷¼ø Æ÷ÇÔ)  ±è¿µ´ë 2003/03/05 5861 1227
690   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¸í·ÉÇà ÀÎÀÚ ¹Þ¾Æ¿À±â  ±è¿µ´ë 2003/03/05 7609 1930
689   [³×Æ®¿÷/ÀÎÅͳÝ] List of raw FTP commands  ±è¿µ´ë 2003/03/05 7588 1956
688   [³×Æ®¿÷/ÀÎÅͳÝ] RFC: Request for Comments  ±è¿µ´ë 2003/03/05 8104 2120
687   [³×Æ®¿÷/ÀÎÅͳÝ] À©µµ¿ìÁî ¼ÒÄÏÀÇ ¿¡·¯¹øÈ£¿¡ ´ëÇÑ ¼³¸í  ±è¿µ´ë 2003/03/05 8135 2759
686   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ÆÄÀÏÀÇ ÇغΠ ±è¿µ´ë 2003/03/05 6675 1756
685   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ListBoxÀÇ ½ºÅ©·Ñ¹Ù¸¦ ¿òÁ÷¿©º¸ÀÚ  ±è¿µ´ë 2003/03/05 5068 1178
684   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] PopupMenuÀÇ Æ¯Á¤ MenuItemÀ¸·Î À̵¿ÇÏ±â  ±è¿µ´ë 2003/03/05 3159 864
683   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] µ¥½ºÅ©Å¾ÀÇ ¾ÆÀÌÄÜÀ» ¸ù¶¥ ¿òÁ÷¿©º¸ÀÚ!!  ±è¿µ´ë 2003/03/05 6677 1952
682   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¸¶¿ì½ºÄ¿¼­¸¦ ƯÁ¤À§Ä¡·Î À̵¿½ÃÅ°±â  ±è¿µ´ë 2003/03/05 6447 1270
681   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] Á¦¾îÆÇÀÇ applet ¶ç¿ì±â  ±è¿µ´ë 2003/03/05 3126 830
680   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] INI ÆÄÀÏÀÌ ÀúÀåÀ» ¾È ÇØ?  ±è¿µ´ë 2003/03/05 4536 1170
679   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¸¶¿ì½º¿µ¿ª Á¦¾îÇÏ±â  ±è¿µ´ë 2003/03/05 3978 1043
678   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¸®½ºÆ®ºä¿¡¼­ µ¿ÀûÀ¸·Î Ä®·³»èÁ¦ÇÏ±â  ±è¿µ´ë 2003/03/05 7244 1448
677   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] Interesting Delphi Keystrokes !  ±è¿µ´ë 2003/03/05 3923 1106
676   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] Application ¼öÁØ¿¡¼­ ÇѱÛ/¿µ¹® Á¦ÇÑµÎ±â  ±è¿µ´ë 2003/03/05 6428 1998
675   [µ¥ÀÌÅͺ£À̽º] dBASE Table File Extensions  ±è¿µ´ë 2003/03/05 4851 1341
674   [µ¥ÀÌÅͺ£À̽º] Paradox Table File Extensions  ±è¿µ´ë 2003/03/05 4080 1078
673   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ÆÄÀÏÀÇ ¼Ó¼º(Attribute) Àбâ / ¹Ù²Ù±â  ±è¿µ´ë 2003/03/05 4327 1105
672   [µ¥ÀÌÅͺ£À̽º] DBGrid ¿¡¼­ ¼öÁ÷ Scroll Bar °¨Ãß±â  ±è¿µ´ë 2003/03/05 4950 1321
671   [À©µµ¿ìÁî API] ÀÎÅÍ³Ý ¸µÅ© ¸¸µé±â  ±è¿µ´ë 2003/03/06 4999 1354
670   [³×Æ®¿÷/ÀÎÅͳÝ] ³» PCÀÇ IPÁÖ¼Ò´Â ?  ±è¿µ´ë 2003/03/06 5624 1283
669   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¹®ÀÚ¿­ÀÇ ¾Ïȣȭ(Password ó¸®) & INI ÆÄÀÏ  ±è¿µ´ë 2003/03/06 6918 1679
668   [À©µµ¿ìÁî API] À©µµ¿ìÀÇ Å¸ÀÌƲ¹Ù¸¦ ¾ø¾Öº¸ÀÚ!  ±è¿µ´ë 2003/03/06 4865 1424
667   [À©µµ¿ìÁî API] Ŭ¸³º¸µåÀÇ ³»¿ëÀ» TXT ÆÄÀÏ¿¡ ´ã¾Æº¸ÀÚ!  ±è¿µ´ë 2003/03/06 6936 1833
666   [½Ã½ºÅÛ] ÇÁ·Î¼¼¼­¸¦ »ý¼º½ÃÄѺ¸ÀÚ!  ±è¿µ´ë 2003/03/06 4877 1281
665   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] µ¨ÆÄÀÌÀÇ Object Inspector ¸ð¹æ  ±è¿µ´ë 2003/03/06 3980 877
  [½Ã½ºÅÛ] ½Ã½ºÅÛÀÇ °¢Á¾ Á¤º¸  ±è¿µ´ë 2003/03/06 7878 1369
663   [µ¥ÀÌÅͺ£À̽º] DBGrid ƯÁ¤ Cell¿¡ »ö»ó³Ö±â  ±è¿µ´ë 2003/03/06 8496 1690
662   [µ¥ÀÌÅͺ£À̽º] DBGrid ÀÇ Æ¯Á¤Çʵ常 Highlighting ½ÃÅ°±â  ±è¿µ´ë 2003/03/06 5026 1185
661   [COM/OLE] How to register an OCX  ±è¿µ´ë 2003/03/06 5368 1221
660   [À©µµ¿ìÁî API] "Windows Á¤º¸" About È­¸é »ç¿ëÇÏ±â  ±è¿µ´ë 2003/03/06 6839 2037
659   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¹®ÀÚ¿­¿¡ ÇѱÛÀÌ ÀÖ´ÂÁö °Ë»ç  ±è¿µ´ë 2003/03/06 4131 1041
658   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TColor°ªÀ» 16Áø¼ö ¹®ÀÚ¿­·Î ¹Ù²Ù±â  ±è¿µ´ë 2003/03/06 6577 1814
657   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] È­¸éº¯°æ½Ã ÄÞÆ÷³ÍÆ® À§Ä¡¿Í Å©±â¸¦ Á¶Á¤  ±è¿µ´ë 2003/03/06 4975 1174
656   [½Ã½ºÅÛ] ¸¶¿ì½º Æ÷ÀÎÅÍ ¼Óµµ ±¸ÇÏ±â  ±è¿µ´ë 2003/03/06 5922 1775
655   [½Ã½ºÅÛ] ¸¶¿ì½º Æ÷ÀÎÅÍ ¼Óµµ ¹Ù²Ù±â  ±è¿µ´ë 2003/03/06 5403 1319
654   [½Ã½ºÅÛ] ¸¶¿ì½º ÀÚÃë(trails)ÀÇ °¹¼ö Á¶Á¤ÇÏ±â  ±è¿µ´ë 2003/03/06 6303 1916
653   [½Ã½ºÅÛ] ¸¶¿ì½º µÎ ¹ø ´©¸£±â ¼Óµµ Á¶Á¤ÇÏ±â  ±è¿µ´ë 2003/03/06 6354 1884
652   [µ¥ÀÌÅͺ£À̽º] ¼³Ä¡µÈ BDE Language Drivers ±¸ÇÏ±â  ±è¿µ´ë 2003/03/06 3722 888

[1][2][3][4][5][6][7] 8 [9][10]..[25] [´ÙÀ½ 10°³]
 

Copyright 1999-2024 Zeroboard / skin by zero