C# - Fastest way to get resource string from assembly

If the resource is in the same assembly as the code, then the following will do:

String resourceValue = MyAssemblyNameSpace.Properties.Resources.ResourceName

Taken from this SO answer.


Assembly assembly = this.GetType().Assembly;
ResourceManager resourceManager = new ResourceManager("Resources.Strings", assembly);
string myString = resourceManager.GetString("value");

string val = Resources.ResourceManager.GetString("resource_name");

Given "resource_name" you can retrieve resource value.