Practical C# 2: Get that spiel (again)

In my last post, I was asked what was my motivation in my implementation over resource files.  To be honest I have none other than the fact that this is just my blog, not a definitive source of authority.

With that, here’s a separate implementation using resource files.

I added a resource file called “Spiels.resx”

The resource file has been in the App_GlobalResources folder.

I then added an entry in the resource file similar to the previous customized xml:

A reference is needed to access the resource file properties and its values. Resource files are accessed by referencing the Resources namespace. (duh)

using Resources;

Now, I have a new and improved solution for accessing spiel information text by calling its static property.

Great feedback. J  Extremely useful for other types such as images and media.

Published 05-10-2009 9:39 PM by avcajipe
Filed under: , , ,

Comments

# re: Practical C# 2: Get that spiel (again)

Sunday, May 10, 2009 7:32 AM by jakelite

great post! another advantage of having resource files is for localization/internationalization. something for another post i guess. =D

cheers!