GeekZilla
Accessing Your resources Through a Static Class
Obviously as conscientious developers you will be keeping all of your strings in resource files, but what if you have static classes how do you access your resources.
Using your stanard OOP design and class instances you would do this:
using System.Resources; using System.Reflection; ResourceManager rm = new ResourceManager("BusinessRules.Resource", this.GetType().Assembly);
But this will not work from a static class as there is no 'this' instance to get. You need to change it to the following:
using System.Resources; using System.Reflection; ResourceManager rm = new ResourceManager("BusinessRules.Resource", Assembly.GetExecutingAssembly());
Greg has too many years experience in developement from VB for DOS all the way through to Windows Workflow and LINQ while covering pretty much every technology in between. A complete MS evangelist he is now Director of the only MS Gold Partner IT services company in Norfolk. Wehere they are producing Web 2 Applications for various sectors, and are currently entering the Haulage industry with their latest product.