资源文件支持多语言问题,急~
我按例子
1)首先添加了两个资源文件
message.zh-cn.resx
message.en.resx
2)在Global文件里,代码如下
protected void Application_BeginRequest(Object sender, EventArgs e)
{
// 用浏览器指定的用户语言来
// 为每个区域性值进行初始化
try
{
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);
}
catch(Exception)
{
// 为不支持的语言提供备用值。仅作为某些特定的情形下的安全措施
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
}
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
}
3)在WEB.CONFI文件里
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
<appSettings>
<add key="DefaultLang" value="zh-cn" />
<!-- zh-cn:簡體中文 zh-tw:繁體中文 en:英文 -->
</appSettings>
就出错了.
大家帮看看了了,急~~~
问题点数:0、回复次数:3Top
1 楼lizheng197953(胖老虎)回复于 2004-11-03 14:56:57 得分 0
铜子们帮忙呀~~Top
2 楼lizheng197953(胖老虎)回复于 2004-11-04 10:57:50 得分 0
一天了都没人愿意教么
Top
3 楼jhyc(脑袋大肚子突,不是腐败就伙夫)回复于 2005-02-04 10:57:16 得分 0
帮你顶,不过你好歹也要把错误信息贴上来啊,不然别人怎么帮你看啊Top




