我试图获得 ressource.resx 的值,但我不能。
我愿意 :
foreach (string certif in ContactCertifications)
{
Type calledType = Type.GetType("TestNamespace.Resources");
String s = (String)calledType.InvokeMember(certif,BindingFlags.InvokeMethod
| BindingFlags.Public |BindingFlags.Static,null,null,null); }
证书 = "PRG_CARTV"
calledType 是:{Name = "Resources" FullName = "TestNamespace.Resources"} 当我在 "String s = (String) calledType" 行中时出现错误:"找不到方法 'TestNamespace.Resources.PRG_CARTV'。 "
当我有 String s = TestNamespace.Resources.PRG_CARTV;
它的工作时,所以我不明白..
当我简单地做:
var myManager = new ResourceManager(typeof(Resources));
var myString = myManager.GetString("PRG_CARTV");
它不起作用,我有一个错误:“找不到指定文化或中性文化的适当资源。确保 \"TestNamespace.Ressources.resources \" 已正确嵌入或链接到程序集中......”