从 C# 中的 .resx 文件读取字符串 [英] read string from .resx file in C#

查看:38
本文介绍了从 C# 中的 .resx 文件读取字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从 C# 中的 .resx 文件中读取字符串?请寄给我指导方针.一步一步

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

推荐答案

这个例子来自 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");

这篇关于从 C# 中的 .resx 文件读取字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆