Reputation: 4467
How to retrieve name and value from Resource file in C# (RESX
)? For example if I have Resource file with name "MimeTypes" and if I want to to retrieve name jpeg
and the return value to be image/jpeg
.
Upvotes: 1
Views: 2020
Reputation: 3440
You can use ResxResourceReader
.
using (var resourceReader = new ResxResourceReader("foo.resx"))
{
foreach (DictionaryEntry resource in resourceReader)
{
string key = resource.Key.ToString();
string value = resource.Value.ToString();
}
}
Upvotes: 2