delphiXE如何判断操作系统是win7还是winXP?delphi7的代码在XE上无效,没有那些函数,有哪位大大知道如何准确判断吗?不知道xe有没有这方面的函数
解决方案 »
- 我做了一个繁体版本的程序,为什么在我的电脑上可以正常显示,而在台湾那边显示却为乱码?
- 触发器的问题
- 分割条的问题
- 如何将文件的内容以二进制的形式存储进SQL SERVER数据库?
- dcom的小问题
- 我用FetchOnDemand和PacketRecords属性建立数据分段,每次下载2条记录,用怎样的代码能让客户端知道已经下载完所有的记录了呢?
- 我有一个用acess97创建的一个table,现在我把他放到了win2000下,2000下用的是access2000!我配置了odbc 后,在delphi里面连接table,出现以
- ”未能找到提供者,可能未被正确安装“ 头痛的问题
- 抢答简单题目,大送分! 为什么我只能送40分? 如何多送啊?
- 如何取得当前屏幕的分辩率,并将当前窗体置于屏幕顶端?
- 如何检测新闻更新
- CxGrid表格问题
var
ver: _OSVERSIONINFOA;
begin
if GetVersionExA(ver) then
with ver do
Result := Trim(
Format(
'%d.%d build %d %s',
[dwMajorVersion, dwMinorVersion, dwBuildNumber, szCSDVersion]))
else
Result := '';
end;function GetWindowsVersion: String; // 读取操作系统版本
var
AWin32Version: Extended;
os: string;
begin
os := 'Windows ';
AWin32Version := StrtoFloat(Format('%d.%d', [Win32MajorVersion, Win32MinorVersion]));
if Win32Platform = VER_PLATFORM_WIN32S then
Result := os + '32'
else if Win32Platform = VER_PLATFORM_WIN32_WINDOWS then
begin
if AWin32Version = 4.0 then Result := os + '95'
else if AWin32Version = 4.1 then Result := os + '98'
else if AWin32Version = 4.9 then Result := os + 'Me'
else Result := os + '9x'
end
else if Win32Platform = VER_PLATFORM_WIN32_NT then
begin
if AWin32Version = 3.51 then Result := os + 'NT 3.51'
else if AWin32Version = 4.0 then Result := os + 'NT 4.0'
else if AWin32Version = 5.0 then Result := os + '2000'
else if AWin32Version = 5.1 then Result := os + 'XP'
else if AWin32Version = 5.2 then Result := os + '2003'
else if AWin32Version = 6.0 then Result := os + 'Vista'
else if AWin32Version = 6.1 then Result := os + '7'
else Result := os;
end
else Result := os + '??'; Result := Result + ' ' + GetWindowsVersionString;
end;
看下Getting the System Version 这个例子
我在偶的Vs2010的msdn里搜索到的
相关的只有
MSWINDOWS
Indicates that the operating environment is Windows. Use MSWINDOWS to test for any flavor of the Windows platform instead of WIN32.
WIN32
Indicates that the operating environment is the Win32 API. Use WIN32 for distinguishing between specific Windows platforms such as 32-bit versus 64-bit Windows. In general, do not limit code to WIN32 unless you know for sure that the code will not work in WIN64. Use MSWINDOWS instead.
CPU386
Indicates that the CPU is an Intel 386 or later.