自己改成Delphi的吧,肯定成功!
AnsiString TfrmMain::GetMainBoardInfo()
{
const MY_BUFSIZE = 256;
HKEY hKey;
TCHAR szProductType[MY_BUFSIZE];
DWORD dwBufLen = MY_BUFSIZE;
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
TEXT("Hardware//Description//System"),
0,
KEY_QUERY_VALUE,
&hKey) != ERROR_SUCCESS) return "";
RegQueryValueEx(hKey,
TEXT("SystemBiosVersion"),
NULL,
NULL,
(LPBYTE)szProductType,
&dwBufLen);
RegCloseKey(hKey);
return AnsiString(szProductType);
}