吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2905|回复: 10
收起左侧

[易语言 转载] 已失效-------

[复制链接]
suyuxi 发表于 2015-5-31 00:06
本帖最后由 suyuxi 于 2016-5-28 15:20 编辑

已失效-------

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

3800CC 发表于 2015-5-31 00:17
有一个API可以读系统的  搞忘了
3800CC 发表于 2015-5-31 00:18
//获取系统版本
BOOL GetOSName( CString& csOsName )
{
OSVERSIONINFOEX osvi;
SYSTEM_INFO si;
BOOL bOsVersionInfoEx;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));

// Try calling GetVersionEx using the OSVERSIONINFOEX structure.
// If that fails, try using the OSVERSIONINFO structure.

osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);

bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi);
if( !bOsVersionInfoEx )
{
  osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
  if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) )
   return FALSE;
}

// Call GetNativeSystemInfo if supported
// or GetSystemInfo otherwise.
else GetSystemInfo(&si);

switch (osvi.dwPlatformId)
{
  // Test for the Windows NT product family.

case VER_PLATFORM_WIN32_NT:

  // Test for the specific product.

  if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 )
  {
   if( osvi.wProductType == VER_NT_WORKSTATION )
   {
    csOsName += _T( "Windows Vista " );
   }
   else
   {
    csOsName += _T( "Windows Server \"Longhorn\" " );
   }
  }

  if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
  {
   if( osvi.wProductType == VER_NT_WORKSTATION &&
    si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64)
   {
    csOsName += _T( "Microsoft Windows XP Professional x64 Edition " );
   }
   else
   {
    csOsName += _T( "Microsoft Windows Server 2003, " );
   }
  }

  if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )
  {
   csOsName += _T( "Microsoft Windows XP " );
  }

  if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )
  {
   csOsName += _T( "Microsoft Windows 2000 " );
  }

  if ( osvi.dwMajorVersion <= 4 )
  {
   csOsName += _T( "Microsoft Windows NT " );
  }

  // Test for specific product on Windows NT 4.0 SP6 and later.
  if( bOsVersionInfoEx )
  {
   // Test for the workstation type.
   if ( osvi.wProductType == VER_NT_WORKSTATION &&
    si.wProcessorArchitecture!=PROCESSOR_ARCHITECTURE_AMD64)
   {
    if( osvi.dwMajorVersion == 4 )
    {
     csOsName += _T( "Workstation 4.0 " );
    }
    else if( osvi.wSuiteMask & VER_SUITE_PERSONAL )
    {
     csOsName += _T( "Home Edition " );
    }
    else
    {
     csOsName += _T( "Professional " );
    }
   }

   // Test for the server type.
   else if ( osvi.wProductType == VER_NT_SERVER ||
    osvi.wProductType == VER_NT_DOMAIN_CONTROLLER )
   {
    if(osvi.dwMajorVersion==5 && osvi.dwMinorVersion==2)
    {
     if ( si.wProcessorArchitecture ==
      PROCESSOR_ARCHITECTURE_IA64 )
     {
      if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
      {
       csOsName += _T("Datacenter Edition for Itanium-based Systems");
      }
      else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
      {
       csOsName += _T("Enterprise Edition for Itanium-based Systems");
      }
     }

     else if ( si.wProcessorArchitecture ==
      PROCESSOR_ARCHITECTURE_AMD64 )
     {
      if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
      {
       csOsName += _T( "Datacenter x64 Edition " );
      }
      else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
      {

      }
      else
      {
       csOsName += _T( "Standard x64 Edition " );
      }
     }
     else
     {
      if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
      {
       csOsName += _T( "Datacenter Edition " );
      }
      else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
      {
       csOsName += _T( "Enterprise Edition " );
      }
      else if ( osvi.wSuiteMask & VER_SUITE_BLADE )
      {
       csOsName += _T( "Web Edition " );
      }
      else
      {
       csOsName += _T( "Standard Edition " );
      }
     }
    }
    else if(osvi.dwMajorVersion==5 && osvi.dwMinorVersion==0)
    {
     if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
     {
      csOsName += _T( "Datacenter Server " );
     }
     else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
     {
      csOsName += _T( "Advanced Server " );
     }
     else
     {
      csOsName += _T( "Server " );
     }
    }
    else  // Windows NT 4.0
    {
     if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
     {
      csOsName += _T( "Server 4.0, Enterprise Edition " );
     }
     else
     {
      csOsName += _T( "Server 4.0 " );
     }
    }
   }
  }
  // Test for specific product on Windows NT 4.0 SP5 and earlier
  else  
  {
   HKEY hKey;
   TCHAR szProductType[256];
   DWORD dwBufLen=256*sizeof(TCHAR);
   LONG lRet;

   lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
    _T("SYSTEM\\CurrentControlSet\\Control\\ProductOptions"),
    0, KEY_QUERY_VALUE, &hKey );
   if( lRet != ERROR_SUCCESS )
    return FALSE;

   lRet = RegQueryValueEx( hKey, TEXT("ProductType"),
    NULL, NULL, (LPBYTE) szProductType, &dwBufLen);
   RegCloseKey( hKey );

   if( (lRet != ERROR_SUCCESS) ||
    (dwBufLen > 256*sizeof(TCHAR)) )
    return FALSE;

   if ( lstrcmpi( TEXT("WINNT"), szProductType) == 0 )
   {
    csOsName += _T( "Workstation " );
   }
   if ( lstrcmpi( TEXT("LANMANNT"), szProductType) == 0 )
   {
    csOsName += _T( "Server " );
   }
   if ( lstrcmpi( TEXT("SERVERNT"), szProductType) == 0 )
   {
    csOsName += _T( "Advanced Server " );
   }
   CString cstmp;
   cstmp.Format( _T( "%d.%d " ), osvi.dwMajorVersion, osvi.dwMinorVersion );
   csOsName += cstmp;
  }

  // Display service pack (if any) and build number.

  if( osvi.dwMajorVersion == 4 &&
   lstrcmpi( osvi.szCSDVersion, TEXT("Service Pack 6") ) == 0 )
  {
   HKEY hKey;
   LONG lRet;

   // Test for SP6 versus SP6a.
   lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
    _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009"),
    0, KEY_QUERY_VALUE, &hKey );
   if( lRet == ERROR_SUCCESS )
   {
    CString cstmp;
    cstmp.Format( _T( "Service Pack 6a (Build %d)" ), osvi.dwBuildNumber & 0xFFFF );
    csOsName += cstmp;
   }        
   else // Windows NT 4.0 prior to SP6a
   {
    CString cstmp;
    cstmp.Format( _T( "%s (Build %d)" ), osvi.szCSDVersion, osvi.dwBuildNumber & 0xFFFF );
    csOsName += cstmp;
   }
   RegCloseKey( hKey );
  }
  else // not Windows NT 4.0
  {
   CString cstmp;
   cstmp.Format( _T( "%s (Build %d)" ), osvi.szCSDVersion, osvi.dwBuildNumber & 0xFFFF );
   csOsName += cstmp;
  }

  break;

  // Test for the Windows Me/98/95.
case VER_PLATFORM_WIN32_WINDOWS:

  if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)
  {
   csOsName += _T( "Microsoft Windows 95 " );
   if (osvi.szCSDVersion[1]=='C' || osvi.szCSDVersion[1]=='B')
   {
    csOsName += _T( "OSR2 " );
   }
  }

  if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)
  {
   csOsName += _T("Microsoft Windows 98 ");
   if ( osvi.szCSDVersion[1]=='A' || osvi.szCSDVersion[1]=='B')
   {
    csOsName += _T("SE " );
   }
  }

  if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
  {
   csOsName += _T("Microsoft Windows Millennium Edition");
  }
  break;

case VER_PLATFORM_WIN32s:

  csOsName += _T("Microsoft Win32s\n");
  break;
}
return TRUE;
}

点评

这个在兼容模式下失效哦 → →有一个从XP时代就出现的API 自己想想  发表于 2015-5-31 00:19
 楼主| suyuxi 发表于 2015-5-31 00:21
q8167005 发表于 2015-5-31 00:22
读环境变量就可以取出
3800CC 发表于 2015-5-31 00:23
还有一个是这个 GetVersionEx

点评

兼容模式下这个命令是兼容环境版本  发表于 2015-5-31 00:25
Perry 发表于 2015-5-31 00:24
本帖最后由 ztd 于 2015-5-31 00:26 编辑

GetNtVersionNumbers
GetNtVersionNumbers(DWORD&dwMajorVer, DWORD& dwMinorVer,DWORD& dwBuildNumber)

天空の幻像 发表于 2015-5-31 00:32
本帖最后由 天空の幻像 于 2015-5-31 00:33 编辑

我有汇编版的哦。。。
[Asm] 纯文本查看 复制代码
.版本 2

.子程序 获取系统版本, 整数型, 公开, 0.未知 1.Win95 2.Win98 3.WinME 4.WinNT 5.Win2000 6.WinXP 7.Win2003 8.Vista 9.Win7 10.Win8

置入代码 ({ 83, 51, 192, 100, 139, 29, 24, 0, 0, 0, 100, 139, 13, 48, 0, 0, 0, 133, 201, 121, 32, 185, 0, 0, 83, 0, 57, 75, 88, 117, 4, 176, 1, 235, 99, 57, 75, 84, 117, 4, 176, 2, 235, 90, 57, 75, 124, 117, 85, 176, 3, 235, 81, 139, 153, 168, 0, 0, 0, 139, 137, 164, 0, 0, 0, 131, 249, 4, 119, 4, 176, 4, 235, 60, 131, 249, 5, 117, 27, 131, 251, 0, 117, 4, 176, 5, 235, 46, 131, 251, 1, 117, 4, 176, 6, 235, 37, 131, 251, 2, 117, 4, 176, 7, 235, 28, 131, 249, 6, 117, 7, 131, 251, 0, 117, 4, 176, 8, 235, 14, 131, 251, 1, 117, 2, 176, 9, 131, 251, 2, 117, 2, 176, 10, 91, 139, 229, 93, 195 })
返回 (0)

 楼主| suyuxi 发表于 2015-5-31 01:37
天空の幻像 发表于 2015-5-31 00:32
我有汇编版的哦。。。
[mw_shl_code=asm,true].版本 2

版本齐了,偶买噶
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-13 23:22

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表