获取BIOS信息
点击次数:46 次 发布日期:2008-11-09 08:41:43 作者:源代码网
|
源代码网推荐 const 源代码网推荐 Subkey: string = ""Hardwaredescriptionsystem""; 源代码网推荐 var 源代码网推荐 hkSB: HKEY; 源代码网推荐 rType: LongInt; 源代码网推荐 ValueSize, OrigSize: Longint; 源代码网推荐 ValueBuf: array[0..1000] of char; 源代码网推荐 procedure ParseValueBuf(const VersionType: string); 源代码网推荐 var 源代码网推荐 I, Line: Cardinal; 源代码网推荐 S: string; 源代码网推荐 begin 源代码网推荐 i := 0; 源代码网推荐 Line := 0; 源代码网推荐 while ValueBuf[i] <> #0 do 源代码网推荐 begin 源代码网推荐 S := StrPas(@ValueBuf[i]); // move the Pchar into a string 源代码网推荐 Inc(Line); 源代码网推荐 Memo1.Lines.Append(Format(""%s Line %d = %s"", 源代码网推荐 [VersionType, Line, S])); // add it to a Memo 源代码网推荐 inc(i, Length(S) 1); 源代码网推荐 // to point to next sz, or to #0 if at 源代码网推荐 end 源代码网推荐 end; 源代码网推荐 end; 源代码网推荐 源代码网推荐 begin 源代码网推荐 if RegOpenKeyEx(HKEY_LOCAL_MACHINE, PChar(Subkey), 0, 源代码网推荐 KEY_READ, hkSB) = ERROR_SUCCESS then 源代码网推荐 try 源代码网推荐 OrigSize := sizeof(ValueBuf); 源代码网推荐 ValueSize := OrigSize; 源代码网推荐 rType := REG_MULTI_SZ; 源代码网推荐 if RegQueryValueEx(hkSB, ""SystemBiosVersion"", nil, @rType, 软件开发网 www.mscto.com 源代码网推荐 @ValueBuf, @ValueSize) = ERROR_SUCCESS then 源代码网推荐 ParseValueBuf(""System BIOS Version""); 源代码网推荐 源代码网推荐 ValueSize := OrigSize; 源代码网推荐 rType := REG_SZ; 源代码网推荐 if RegQueryValueEx(hkSB, ""SystemBIOSDate"", nil, @rType, 源代码网推荐 @ValueBuf, @ValueSize) = ERROR_SUCCESS then 源代码网推荐 Memo1.Lines.Append(""System BIOS Date "" ValueBuf); 源代码网推荐 源代码网推荐 ValueSize := OrigSize; 源代码网推荐 rType := REG_MULTI_SZ; 源代码网推荐 if RegQueryValueEx(hkSB, ""VideoBiosVersion"", nil, @rType, 源代码网推荐 @ValueBuf, @ValueSize) = ERROR_SUCCESS then 源代码网推荐 ParseValueBuf(""Video BIOS Version""); 源代码网推荐 源代码网推荐 ValueSize := OrigSize; 源代码网推荐 rType := REG_SZ; 源代码网推荐 if RegQueryValueEx(hkSB, ""VideoBIOSDate"", nil, @rType, 源代码网推荐 @ValueBuf, @ValueSize) = ERROR_SUCCESS then 源代码网推荐 Memo1.Lines.Append(""Video BIOS Date "" ValueBuf); 源代码网推荐 finally 源代码网推荐 RegCloseKey(hkSB); 源代码网推荐 end; 源代码网推荐 end; 源代码网推荐 源代码网供稿. |
