【问题标题】:get namespace of resx to access string获取 resx 的命名空间以访问字符串
【发布时间】:2013-11-04 15:45:29
【问题描述】:

我正在尝试在 c# 代码隐藏中访问 resx。

我看过这个答案: read string from .resx file in C#

,但不知道在此语句中用什么代替“项目”:

ResourceManager rm = new ResourceManager("items", Assembly.GetExecutingAssembly());

在哪里可以看到 resx 的命名空间?

谢谢

【问题讨论】:

  • 你的项目中有这个 resx 文件吗?您知道您要读取什么 resx 文件,还是动态文件?见msdn.microsoft.com/en-us/library/yfsz7ac5.aspx
  • @TimS.Yes 我的项目中有资源在文件夹 pages/app_localResources/MyPage.aspx.resx 下

标签: c# resx


【解决方案1】:

这是你想要做的吗?

 string foo = GetLocalResourceObject("NameOfTheResource").ToString();

【讨论】:

  • 什么是GetLocalResourceObject
猜你喜欢
  • 2010-11-22
  • 1970-01-01
  • 2012-03-19
  • 1970-01-01
  • 2011-02-01
  • 1970-01-01
  • 1970-01-01
  • 2013-03-08
  • 1970-01-01
相关资源
最近更新 更多