如何判断操作系统 是中文版还是英文版?

swordliuyang 2009-04-03 03:52:26
用什么方法得到 win xp操作系统 是英文版本 还是简体中文版
有函数么 是哪个?
...全文
1410 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
biweilun 2009-04-06
  • 打赏
  • 举报
回复
使用如下的API。返回值可以判断系统语言和版本
LANGID GetSystemDefaultLangID(void);

返回值参考见http://msdn.microsoft.com/zh-cn/library/dd318693(en-us,VS.85).aspx
teerhu 2009-04-03
  • 打赏
  • 举报
回复
学习
wuyq11 2009-04-03
  • 打赏
  • 举报
回复
string Ci = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
if (Ci == "zh-CN")
{
MessageBox.Show("简体中文!");
}
else
{
if (Ci == "Zh-TW")
{
MessageBox.Show("繁体中文!");
}
else
{
MessageBox.Show("繁体中文!");
}
}
swordliuyang 2009-04-03
  • 打赏
  • 举报
回复
通过 API 函数GetSystemDefaultLCID 判断系统的语言
Option Explicit
Dim lang As String
Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
Private Sub Form_Load()
Dim LocaleID As Long
LocaleID = GetSystemDefaultLCID
Select Case LocaleID
Case &H404
MsgBox "当前系统为:中文繁体", , "语言"
Case &H804
MsgBox "当前系统为:中文简体", , "语言"
lang = "1"
Case &H409
MsgBox "当前系统为:英文", , "语言"
lang = "2"
End Select
End Sub
空心兜兜 2009-04-03
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 ccs02287 的回复:]
应该就是那些
比如众所周知的XP中文专业版都是....2600
[/Quote]

排除那些XX修改版、XX美化版
空心兜兜 2009-04-03
  • 打赏
  • 举报
回复
应该就是那些
比如众所周知的XP中文专业版都是....2600
热学沸腾56 2009-04-03
  • 打赏
  • 举报
回复
学习。。
swordliuyang 2009-04-03
  • 打赏
  • 举报
回复
楼上, 我仍然不能从版本信息中确定 操作系统的 语言版本 请明确讲出来好吗 谢谢。
我不懂电脑 2009-04-03
  • 打赏
  • 举报
回复
主要就是判断版本号。
GetVersionEx

The GetVersionEx function obtains extended information about the version of the operating system that is currently running.

To obtain information for the operating system on a remote computer, use the NetWkstaGetInfo function, the Win32_OperatingSystem WMI class, or the OperatingSystem property of the IADsComputer interface.

To compare the current system version to a required version, use the VerifyVersionInfo function instead of using GetVersionEx to perform the comparison yourself.


BOOL GetVersionEx(
LPOSVERSIONINFO lpVersionInfo
);
Parameters
lpVersionInfo
[in, out] Pointer to an OSVERSIONINFO data structure that the function fills with operating system version information.
Before calling the GetVersionEx function, set the dwOSVersionInfoSize member of this structure to sizeof(OSVERSIONINFO).

Windows NT 4.0 SP6 and later: This member can be a pointer to an OSVERSIONINFOEX structure. Set the dwOSVersionInfoSize member to sizeof(OSVERSIONINFOEX) to identify the structure type.
Return Values
If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError. The function fails if you specify an invalid value for the dwOSVersionInfoSize member of the OSVERSIONINFO or OSVERSIONINFOEX structure.

Remarks
Identifying the current operating system is usually not the best way to determine whether a particular operating system feature is present. This is because the operating system may have had new features added in a redistributable DLL. Rather than using GetVersionEx to determine the operating system platform or version number, test for the presence of the feature itself. For more information, see Operating System Version.

To verify whether the current operating system is either Windows XP Media Center Edition or Tablet PC Edition, use the GetSystemMetrics function.

Example Code [C++]
When using the GetVersionEx function to determine whether your application is running on a particular version of the operating system, check for version numbers that are greater than or equal to the desired version numbers. This ensures that the test succeeds for later versions of the operating system. For example, if your application requires Windows XP, use the following test.

osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx (&osvi);
bIsWindowsXPorLater =
( (osvi.dwMajorVersion > 5) ||
( (osvi.dwMajorVersion == 5) && (osvi.dwMinorVersion >= 1) );

Example Code
For an example that identifies the current operating system, see Getting the System Version.

Requirements
Client Requires Windows XP, Windows 2000 Professional, Windows NT Workstation 3.5 and later, Windows Me, Windows 98, or Windows 95.
Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 3.5 and later.
Header Declared in Winbase.h; include Windows.h.

Library Link to Kernel32.lib.

DLL Requires Kernel32.dll.
Unicode Implemented as GetVersionExW (Unicode) and GetVersionExA (ANSI). Note that Unicode support on Windows Me/98/95 requires Microsoft Layer for Unicode.

7,540

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧