C# 将输入法设置为英文

方法

private void SwitchToLanguageMode(string cultureType)
        {
            var installedInputLanguages = InputLanguage.InstalledInputLanguages;

            if (installedInputLanguages.Cast().Any(i => i.Culture.Name == cultureType))
            {
                InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(System.Globalization.CultureInfo.GetCultureInfo(cultureType));
            }
        }

调用

SwitchToLanguageMode("en-US");

你可能感兴趣的:(C#,开发语言,C#,输入法更换)