468,507 Members | 1,565 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,507 developers. It's quick & easy.

Find all keys from a specific global resource


I'm having some difficulties getting all possible keys from a specific
resource class.
Let's say I have a file named: MyProj.TranslationStrings.resx in my
App_GlobalResources folder

And let's say the .resx file contains two entries:
"status.0" with value "Disabled"
"status.1" with value "Enabled"

status.0 is a resource key and "Disabled" is the value of that key.

I know I can programmatically retrieve values from those resource keys
GetGlobalResourceObject("MyProj.TranslationStrings ", "status.0")

Function returns an string object with the value "Disabled".

.... or I can use the Resources namespace (that's called strong typing,
I think...): Resources.MyProj.TranslationString.status_0 <- this is a
String object with a value "Disabled"

But how do I get all the possible resource keys from that resource
programmatically. I'd like to have a function that would return an
array or something I could iterate.

String[] AllKeys = RetrieveAllResourceKeys( "MyProj.TranslationStrings"

Function would have to get all resource keys during run-time from the
assembly and not the .resx file.

Any ideas on how would I implement such function?

Any help would be appreciated, thanks.

Oct 6 '06 #1
0 2223

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by martin | last post: by
4 posts views Thread by Broeisi | last post: by
1 post views Thread by Rotsey | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.