多语言设置,获取对应的资源文件配置
class Program { static void Main(string[] args) { var isContinue = true; while (isContinue) { Console.WriteLine("请输入Language Code:"); var languageCode = Console.ReadLine(); //languageCode一般有zh-CN,zh-Hant,zh-Hans,ja-JP,en,en-US等, //这样就能匹配到对应的资源文件了,如R.zh-Hans,R.zh-Hant,R.ja-JP,R等 CultureInfo culture = new CultureInfo(languageCode); Thread.CurrentThread.CurrentCulture = culture; Thread.CurrentThread.CurrentUICulture = culture; Console.WriteLine(R.Name); Console.WriteLine("是否继续?Y/N: "); isContinue = string.Equals("Y", Console.ReadLine(), StringComparison.OrdinalIgnoreCase); } } }