ResourceManager fileText = null;
            string path = "ResourceCon.test.Language";
            fileText = new ResourceManager(path, typeof(Test).Assembly);
            string res = fileText.GetString("PortalSettingKey_hisBoxFocus", new CultureInfo("en")); //new CultureInfo("zh-CN")

上面代码中ResourceCon为类库名。Test为类库下的一个文件。需要在类库下建一个test文件夹。放置两个资源文件ResCon.test.Language.resources和ResCon.test.Language.zh-CN.resources

 

ResourceManager构造函数表示在集合里查找含有path名称的resource文件
GetString方法表示指定语言查找key对应值

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-03
  • 2022-12-23
  • 2021-11-27
  • 2021-11-10
  • 2019-12-12
  • 2022-01-12
  • 2022-12-23
相关资源
相似解决方案