获取Windowns参数

 
  1. function Pub_GetOSInfo: string{获取Windowns}
  2. var myWin: string;
  3.   Platform: string;
  4.   BuildNumber: Integer;
  5. begin
  6.   myWin := '';
  7.   case Win32Platform of
  8.     VER_PLATFORM_WIN32_WINDOWS:
  9.       begin
  10.         Platform := 'Windows 95';
  11.         BuildNumber := Win32BuildNumber and $0000FFFF;
  12.       end;
  13.     VER_PLATFORM_WIN32_NT:
  14.       begin
  15.         Platform := 'Windows NT';
  16.         BuildNumber := Win32BuildNumber;
  17.       end;
  18.   else
  19.     begin
  20.       Platform := 'Windows';
  21.       BuildNumber := 0;
  22.     end;
  23.   end;
  24.   if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) or
  25.     (Win32Platform = VER_PLATFORM_WIN32_NT) then
  26.   begin
  27.     if Win32CSDVersion = '' then
  28.       myWin := Format('%s %d.%d (Build %d)', [Platform, Win32MajorVersion,
  29.         Win32MinorVersion, BuildNumber])
  30.     else
  31.       myWin := Format('%s %d.%d (Build %d: %s)', [Platform, Win32MajorVersion,
  32.         Win32MinorVersion, BuildNumber, Win32CSDVersion]);
  33.   end
  34.   else
  35.     myWin := Format('%s %d.%d', [Platform, Win32MajorVersion,
  36.       Win32MinorVersion]);
  37.   Result := myWin;
  38. end;
  39. function Pub_GetOSMemory: string{获取Windows 可用物理内存}
  40. var
  41.   MS: TMemoryStatus;
  42. begin
  43.   MS.dwLength := SizeOf(TMemoryStatus);
  44.   GlobalMemoryStatus(MS);
  45. //  Result := FormatFloat('#,###" KB"', MS.dwTotalPhys div 1024);
  46.   Result := FormatFloat('#,###" KB"', MS.dwTotalPhys shr 10);
  47. end;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值