📄 resources.cs
字号:
/*
* .NET 多语言解决方案
* 作者:蝈蝈
* 博客:http://www.cnblogs.com/hotsoho.net
* 时间:2005年1月3日
*/
using System;
using System.Globalization;
using System.Resources;
namespace SystemFramework
{
/// <summary>
/// 资源读取 的摘要说明。
/// </summary>
public class Resources
{
private ResourceManager rm = null;
private CultureInfo ci = null;
public Resources(Type typeObj,CultureInfo ci)
{
rm = new ResourceManager(typeObj);
this.ci = ci;
}
public Resources(Type typeObj,string cultureName):this(typeObj,new CultureInfo(cultureName))
{
}
public string this[string id]
{
get
{
return rm.GetString(id,ci);
}
}
public static string GetResource(string id,Type typeObj,CultureInfo ci)
{
ResourceManager rms = new ResourceManager(typeObj);
return rms.GetString(id,ci);
}
public static string GetResource(string id,Type typeObj)
{
return GetResource(id,typeObj,HttpSession.GetCultureInfo);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -