Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 非英语系统上的WMI查询_C#_.net_Wmi_Culture - Fatal编程技术网

C# 非英语系统上的WMI查询

C# 非英语系统上的WMI查询,c#,.net,wmi,culture,C#,.net,Wmi,Culture,我必须在德语和英语计算机上查询WMI Api。但是在不同的系统上,会有不同的结果 例如: 我必须查询“Msvm\U计算机系统”。有一个名为“Caption”的属性。在英国计算机上,结果是“虚拟机”,而在德国计算机上,结果是“Virtueller计算机” 我怎样才能强迫语言来说服我们呢 不知道它是否有效,但值得一试。执行查询之前,将当前线程的区域性更改为: 你能补充一下为什么这很重要吗?您希望如何处理该值而不是将其显示给用户?我必须编写一些查询来查询hyper-v vm的状态。问题是:我必须在c代

我必须在德语和英语计算机上查询WMI Api。但是在不同的系统上,会有不同的结果

例如:

我必须查询“Msvm\U计算机系统”。有一个名为“Caption”的属性。在英国计算机上,结果是“虚拟机”,而在德国计算机上,结果是“Virtueller计算机”


我怎样才能强迫语言来说服我们呢

不知道它是否有效,但值得一试。执行查询之前,将当前线程的区域性更改为:


你能补充一下为什么这很重要吗?您希望如何处理该值而不是将其显示给用户?我必须编写一些查询来查询hyper-v vm的状态。问题是:我必须在c代码中处理结果。
Thread.CurrentThread.CurrentCulture = CultureInfo.Invariant;