How do you retrieve resources at run time?Steps:
1. Create a reference to the assembly that contains the resources that you want to access.
2. Create an instance of the ResourceManager class using the assembly that contains the desired resource.
3. Specify the base name of the embedded file and provide a reference to the assembly that contains the resources.
4. Use the GetString method to retrieve string resources or the GetObject method to retrieve object resources.
ResourceManager:
- This class provides access to resources at run time.
- ResourceManager.GetString method is used to retrieve the strings.
- It uses the resource fallback process to control how the app retrieves culture-specific resources.
- ResourceManager.GetObject or ResourceManager.GetStream method is used to retrieve non-string resources.
- This class is associated with an assembly and manages retrieval of the resources embedded in that assembly.
|