如题。我现在编程只能辨别操作系统是Windows 2000或其他操作系统(Win95、Win98、Win98SE、WinXP),但无法区别Windows 2000是Server、Professional、Advanced Server中的哪一个。
解决方案 »
- 如何获取文件尺寸
- 网络游戏,比如传奇自动更新程序是用什么工具开发的?
- 关于Frame的简单问题!在线等。
- 无法为更新行集定位,一些值可能已在最后读取后更改
- 在delphi中$EXTERNALSYM是什么意思?
- 如何实现一个带编辑框的TreeView控件,请帮忙给点思路!可再加分!
- install控件的时候报:.bpl can't be installed because it is not a design time package?
- Mts怎么返回一个Recordset给ASP页面调用?
- 如何让combobox的text只读用设置它的style属性当你按Backspace键时text被请空了??
- 学校的办公自动化软件应该具备哪些功能?请指教!
- 请教delphi7的打印问题?
- 关于读文本文件
function GetWindowsVersion: string;
var
// windows api structure
VersionInfo: TOSVersionInfo;
begin
// get size of the structure
VersionInfo.dwOSVersionInfoSize := SizeOf(VersionInfo);
// populate the struct using api call
GetVersionEx(VersionInfo);
// platformid gets the core platform
// major and minor versions also included.
with VersionInfo do
begin
case dwPlatformid of
0 : begin
result := 'Windows 3.11';
end; // end 0 1 : begin
case dwMinorVersion of
0 : result := 'Windows 95';
10: begin
if ( szCSDVersion[ 1 ] = 'A' ) then
Result :='Windows 98 SE'
else
Result := 'Windows 98';
end; // end 10
90 : result := 'Windows Millenium';
else
result := 'Unknown Version';
end; // end case
end; // end 1 2 : begin
case dwMajorVersion of
3 : result := 'Windows NT ' +
IntToStr(dwMajorVersion) + '.' +
IntToStr(dwMinorVersion);
4 : result := 'Windows NT ' +
IntToStr(dwMajorVersion) + '.' +
IntToStr(dwMinorVersion);
5 : begin
case dwMinorVersion of
0 : result := 'Windows 2000';
1 : result := 'Windows xp';
end; // end case
end; // end 5
else
result := 'Unknown Version';
end; // end case
// service packs apply to the NT/2000 platform
if szCSDVersion <> '' then
result := result + ' Service pack: ' + szCSDVersion;
end; // end 2
else
result := 'Unknown Platform';
end; // end case
// add build info.
result := result + ', Build: ' +
IntToStr(Loword(dwBuildNumber)) ;
end; // end version info
end; // GetWindowsVersion
type
TOSVersion = (osUnknown, os95, os95OSR2, os98, os98SE, osNT3, osNT4, os2K, osME,osXP); Function IsNT(var OS:string): boolean;//判断是否是NT系统
Function GetOS :TOSVersion; //获得操作系统//获取操作系统
function GetOS;
var
OS :TOSVersionInfo;
begin
ZeroMemory(@OS,SizeOf(OS));
OS.dwOSVersionInfoSize:=SizeOf(OS);
GetVersionEx(OS);
Result:=osUnknown;
if OS.dwPlatformId=VER_PLATFORM_WIN32_NT then
begin
case OS.dwMajorVersion of
3: Result:=osNT3;
4: Result:=osNT4;
5: begin
if OS.dwMinorVersion>=1 then
Result:=osXP
else
Result:=os2K;
end;
end;
end
else
begin
if (OS.dwMajorVersion=4) and (OS.dwMinorVersion=0) then
begin
Result:=os95;
if (Trim(OS.szCSDVersion)='B') then
Result:=os95OSR2;
end
else
if (OS.dwMajorVersion=4) and (OS.dwMinorVersion=10) then
begin
Result:=os98;
if (Trim(OS.szCSDVersion)='A') then
Result:=os98SE;
end
else
if (OS.dwMajorVersion=4) and (OS.dwMinorVersion=90) then
Result:=osME;
end;
end;//判断是否时NT系统
function IsNT(var OS:string): boolean;
var
OSVI :TOSVersion;
begin
OS:='不知道';
OSVI:=GetOs;
if OSVI=osNT3
then OS:='Window NT3';
if OSVI=OSNT4
then OS:='Window NT4';
if OSVI=os2K
then OS:='Winodw 2000';
if OSVI=os95
then OS:='Window 95';
if OSVI=os95OSR2
then OS:='Window 97';
if OSVI=os98
then OS:='Winodw 98';
if OSVI=os98SE
then OS:='Winodw 98SE';
if OSVI=osME
then OS:='Winodw ME';
Result:=GetOS in [osNT3,osNT4,os2K,osXP];
end;
ServerNT is Advance Server
LaminNT is Server
WinNT is Professional