有什么办法?
注意:我只想判断出winNT系统,不包括其他的系统。
目的:只想让程序的兼容全部Win系统,因为NT的内核与其他系统有一些不同
有什么办法,有没有这方面的源代码???

解决方案 »

  1.   

    Win32Platform = VER_PLATFORM_WIN32_NT
      

  2.   

    and Win32MajorVersion <= 4
      

  3.   

    Win2k: (Win32MajorVersion >= 5) and (Win32Platform = VER_PLATFORM_WIN32_NT)
    WinME: ((Win32Platform = VER_PLATFORM_WIN32_WINDOWS) 
           and (Win32MajorVersion >= 4) 
           and (Win32MinorVersion >= 90))
      

  4.   

    const
      OS_WINNT = 1; { WINDOWS NT}
      OS_WIN32 = 0; { WINDOWS 95 OR 98}
      OS_WINS = 2; { WIN32 UNDER WIN3.1}
      OS_WINNT4 = 3; { NT 4 }
      OS_WIN2k = 4; { Win2k - duh! }
    function WinVer: Integer;
    var
      OSVerInfo: TOSVersionInfo;
    begin
      try
        OSVerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
        GetVersionEx(OSVerInfo);
        result := OSVerInfo.dwMajorVersion;
        case OSVerInfo.dwPlatformID of
          VER_PLATFORM_WIN32s: Result := OS_WINS;
          VER_PLATFORM_WIN32_WINDOWS: result := OS_WIN32;
          VER_PLATFORM_WIN32_NT: begin
            case OSVerInfo.dwMajorVersion of
              1: result := OS_WINNT;
              2: result := OS_WINNT;
              3: result := OS_WINNT;
              4: result := OS_WINNT4;
              5: result := OS_WIN2k;
            end;
          end
        else
          result := OSVerInfo.dwPlatformID;
        end;
      except
        result := -1;
      end;
    end;
      

  5.   

    win95    4.0.950  9x
    winnt4   4.0.1381  NT
    win98    4.1.1998  9x
    win98se  4.1.2222  9x
    winme    4.9.3000  9x
    win2k    5.0.2195  NT
    winxp    5.1.2600  NT
    win2003  5.2.3790  NT