Return to Snippet

Revision: 2392
at February 8, 2007 02:39 by faltumk


Initial Code
/*
The resource file stores items as name-value pair.

To get string values from the resource files (.resx) added in your project, use the following code.
*/

//Name Spaces Required
using System.Resources;
using System.Reflection;

// Create the resource manager.
 Assembly assembly = this.GetType().Assembly;
         
//ResFile.Strings -> <Namespace>.<ResourceFileName i.e. Strings.resx> 
resman = new ResourceManager("StringResources.Strings", assembly);

// Load the value of string value for Client
strClientName = resman.GetString("Client");

Initial URL


Initial Description
The resource file stores items as name-value pair.
To get string values from the resource files (.resx) added in your project, use the following code.

Initial Title
CSharp Reading String from Resource File                    .

Initial Tags


Initial Language
C#