read string from .resx file in C#

前端 未结 14 2210
一生所求
一生所求 2020-12-02 06:01

How to read the string from .resx file in c#? please send me guidelines . step by step

14条回答
  •  离开以前
    2020-12-02 06:50

    This example is from the MSDN page on ResourceManager.GetString():

    // Create a resource manager to retrieve resources.
    ResourceManager rm = new ResourceManager("items", Assembly.GetExecutingAssembly());
    
    // Retrieve the value of the string resource named "welcome".
    // The resource manager will retrieve the value of the  
    // localized resource using the caller's current culture setting.
    String str = rm.GetString("welcome");
    

提交回复
热议问题