Resource files are just XML, where the important part is a series of
<data name="resource name"><value>localized string</value></data>
(though there is a little bit of other stuff).
Here's a sample of parsing it with C# 2.0 (hopefully I did this right, I haven't worked with XML much):
Dictionary<string, string> resourceDict = new Dictionary<string,string>();
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath("~/App_GlobalResources/Resources.resx"));
XmlNodeList resourceList = doc.GetElementsByTagName("data");
foreach (XmlNode node in resourceList)
{
string name = node.Attributes["name"].Value;
string value = ""; // fallback value if for some reason it doesn't have a value
foreach (XmlNode childNode in node.ChildNodes)
if (childNode.Name.Equals("value"))
{
value = childNode.InnerText;
break;
}
resourceDict.Add(name, value);
} If you're using C# 3.0, this becomes a lot easier:
var resourceDict = from n in XElement.Load(Server.MapPath("~/App_GlobalResources/Resources.resx")).Elements("data") select new { Name = (string)n.Attribute("name"), Value = (string)n.Element("value") };