how to add items to resource file (resx) on run time?
i have some global resource files that store my dictionary for app.
when a key is not in the resource file i return the key.public Object MyGetGlobalResourceObject(string classKey, string resourceKey)
{
try
{
if (GetGlobalResourceObject(classKey, resourceKey) == null)
{
return resourceKey;
}
else
return GetGlobalResourceObject(classKey, resourceKey);
}
catch (MissingManifestResourceException ex)
{
开发者_如何学运维 return classKey + "-" + resourceKey + " " + ex.ToString();
}
}
i want to add the resourceKey to the classKey file.
you can use ResXResourceReader class, here is an example:
http://www.codeproject.com/KB/cs/Editing_a_ResourceFile.aspx?msg=3406807
精彩评论