且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从 C# 中的 .resx 文件读取字符串

更新时间:2023-11-13 16:17:34

这个例子来自 ResourceManager.GetString() 上的 MSDN 页面:

// 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");