.net - Reading .resx files programmatically -


i have application contents of e-mails sent stored in .resx file.
asp.net application, .resx file lives in /app_globalresources

when need send e-mail, i'm reading using:

 httpcontext.getglobalresourceobject("mailcontents", "emailid").tostring 

now, need use same mailing method project (not website). mailing method in dll projects in solution share.

in other project, don't have httpcontext.

how can read these resources?

my current approach is, inside mailing class, check whether httpcontext.current null, , if so, use separate method.
separate method i'm looking @ right (after resigning myself fact there's nothing better) have path .resx file of website stored in app.config file, , somehow read file.
started trying system.resources.resourcereader, looks wants .resources file, not .resx one.

i think answered own question...
there's resxresourcereader class. couldn't find because it's in windows forms namespace, not included in current dll references.

unfortunately, let me iterate through results, i'll implement cute caching (read: memoization) on it...


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -