1.以下两种方式都是从默认的资源文件里读取字符串。

方法一:

string te= Resources.ResourceManager.GetString("a");
             
           

方法二:


ResourceManager fee = new
ResourceManager("RedirectorConfigurationTool.Properties.Resources",this.GetType().Assembly);
              
string a=  fee.GetString("a");

其实打开 vs生成的Resource类,可以看到,此类是VS自动生成的,同时这也是访问资源文件的一个例子。

2.未来支持Globalization,也就是让系统创建的控件,也使用资源文件,我们还需要设置一个属性。Localizable = true.如图
本地化的设置和读取

相关文章:

  • 2021-09-11
  • 2021-12-19
  • 2022-01-16
  • 2022-01-09
  • 2022-03-06
  • 2021-12-12
  • 2021-12-25
猜你喜欢
  • 2022-02-08
  • 2021-05-07
  • 2022-12-23
  • 2021-12-19
  • 2021-12-19
  • 2022-12-23
相关资源
相似解决方案