如何在上下文中将语言更改为英语 [英] How to change language to english for the process in context

查看:163
本文介绍了如何在上下文中将语言更改为英语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了使用日语设置的Windows系统.执行命令"systeminfo"时,使用Createprocess它将字符写入日本.如何获得英文输出?

I have a Windows system installed with Japanese language settings.When I execute the command "systeminfo" using Createprocess it writes the character in Japan.How can i get the output in English?

 

我尝试使用

setlocale(LC_ALL,"English");

setlocale(LC_ALL,"English");

setlocale(lC_ALL,"C").

setlocale(lC_ALL,"C").

_putenv("LANG = C";

_putenv("LANG=C";

 

一切都以徒劳告终.

 

我也不想更改 中的语言设置控制面板,因为这会影响系统上运行的其他应用程序.

Also I do not want to change the language settings in  control panel as this will affect other applications running on the system.

 

 

请帮助.

 

专家

推荐答案

为什么不使用GetSystemInfo API并获得所需的信息.

why dont you use the GetSystemInfo API and get what ever information you want.

以下示例使用 GetSystemInfo 函数可获取硬件信息,例如OEM标识符,处理器类型,页面大小等.该示例在控制台中显示信息.

The following example uses the GetSystemInfo function to obtain hardware information such as the OEM identifier, processor type, page size, and so on. The example displays the information in the console.

 

 

#include <windows.h>
#include <stdio.h>

void main()
{
  SYSTEM_INFO siSysInfo;
 
  // Copy the hardware information to the SYSTEM_INFO structure. 
 
  GetSystemInfo(&siSysInfo); 
 
  // Display the contents of the SYSTEM_INFO structure. 

  printf("Hardware information: \n"); 
  printf(" OEM ID: %u\n", siSysInfo.dwOemId);
  printf(" Number of processors: %u\n", 
   siSysInfo.dwNumberOfProcessors); 
  printf(" Page size: %u\n", siSysInfo.dwPageSize); 
  printf(" Processor type: %u\n", siSysInfo.dwProcessorType); 
  printf(" Minimum application address: %lx\n", 
   siSysInfo.lpMinimumApplicationAddress); 
  printf(" Maximum application address: %lx\n", 
   siSysInfo.lpMaximumApplicationAddress); 
  printf(" Active processor mask: %u\n", 
   siSysInfo.dwActiveProcessorMask); 
}

萝卜


这篇关于如何在上下文中将语言更改为英语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆