如何从C#检查是否安装了复杂脚本和rtl语言的文件?

时间:2022-07-26 06:59:25

How to check, from C#, are files for complex script and rtl languages (Regional and Language settings) installed?

如何从C#检查是否安装了复杂脚本和rtl语言(区域和语言设置)的文件?

Edit: Or is there another way of checking whether right to left text will display correctly in my form?

编辑:或者是否有另一种方法来检查从右到左文本是否会在我的表单中正确显示?

Edit for better explanation (I hope :)) I'm creating an application that will use Arabic letters (free dictionary). So, I want to check are: "Files for complex script and right-to-left languages(Including Thai)" (CheckBox in "Regional and Language Options" in Language Tab) installed (Is CheckBox checked.). If they are not installed, Arabic words will not display correctly,and I want to warn user if that is the case.

编辑以获得更好的解释(我希望:))我正在创建一个将使用阿拉伯字母(免费字典)的应用程序。所以,我想检查的是:“复杂脚本和从右到左语言的文件(包括泰语)”(在语言选项卡中的“区域和语言选项”中的CheckBox)安装(选中CheckBox)。如果没有安装,阿拉伯语单词将无法正确显示,我想警告用户是否是这种情况。

Thanks

2 个解决方案

#1


1  

I'm not sure if this will get you all the way there but, you can query WMI. If you are using .Net, check out the System.Management namespace. You will be interested in...

我不确定这是否会让你一直到那里,但是,你可以查询WMI。如果您使用的是.Net,请查看System.Management命名空间。你会对......感兴趣

Namespace: root\cimv2 Class: Win32_OperatingSystem Properties: MUILanguages and/or Locale

命名空间:root \ cimv2类:Win32_OperatingSystem属性:MUILanguages和/或Locale

#2


0  

Thank you for your info. I queried WMI for Win32_OperatingSystem Properties. It returns Win32_OperatingSystem Class with all fields and properties except MUILanguages :(

谢谢你的信息。我查询了Win32_OperatingSystem属性的WMI。它返回Win32_OperatingSystem类,包含除MUILanguages之外的所有字段和属性:(

...
  uint32 MaxNumberOfProcesses;
  uint64 MaxProcessMemorySize;
  string MUILanguages[]; //I don't see this field, and all others I see
  string Name;
  uint32 NumberOfLicensedUsers;
...

Any help? I use WinXP SP2 and VS2005

有帮助吗?我使用的是WinXP SP2和VS2005

Code I used refereence: System.Management;

代码我使用了refereence:System.Management;

string ConfigNamespace = @"\\.\root\cimv2";
string query = "select * from Win32_OperatingSystem";

ManagementObjectSearcher searcher = 
  new ManagementObjectSearcher(ConfigNamespace, query);

ManagementObjectCollection collection = searcher.Get();

foreach (ManagementObject item in collection)
{
  //PropertyData pd = item.Properties["MUILanguages"];

  foreach (PropertyData data in item.Properties)
  {

  }
}

#1


1  

I'm not sure if this will get you all the way there but, you can query WMI. If you are using .Net, check out the System.Management namespace. You will be interested in...

我不确定这是否会让你一直到那里,但是,你可以查询WMI。如果您使用的是.Net,请查看System.Management命名空间。你会对......感兴趣

Namespace: root\cimv2 Class: Win32_OperatingSystem Properties: MUILanguages and/or Locale

命名空间:root \ cimv2类:Win32_OperatingSystem属性:MUILanguages和/或Locale

#2


0  

Thank you for your info. I queried WMI for Win32_OperatingSystem Properties. It returns Win32_OperatingSystem Class with all fields and properties except MUILanguages :(

谢谢你的信息。我查询了Win32_OperatingSystem属性的WMI。它返回Win32_OperatingSystem类,包含除MUILanguages之外的所有字段和属性:(

...
  uint32 MaxNumberOfProcesses;
  uint64 MaxProcessMemorySize;
  string MUILanguages[]; //I don't see this field, and all others I see
  string Name;
  uint32 NumberOfLicensedUsers;
...

Any help? I use WinXP SP2 and VS2005

有帮助吗?我使用的是WinXP SP2和VS2005

Code I used refereence: System.Management;

代码我使用了refereence:System.Management;

string ConfigNamespace = @"\\.\root\cimv2";
string query = "select * from Win32_OperatingSystem";

ManagementObjectSearcher searcher = 
  new ManagementObjectSearcher(ConfigNamespace, query);

ManagementObjectCollection collection = searcher.Get();

foreach (ManagementObject item in collection)
{
  //PropertyData pd = item.Properties["MUILanguages"];

  foreach (PropertyData data in item.Properties)
  {

  }
}