cronym id='9hRLA'>
本文介绍了制作多语言网站的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用(, c#) 制作了一个网站,其内容为.现在我需要以支持多种语言的方式制作这个网站,即(德语,法语).// 所有值将显示各自选择的语言在搜索时我开始知道有一些方法像
I have made a (, c#) and its in .Now i have a to make this in such a way that is ie (,). // all will i came to know are some ways like
坦率地说,我不同意第三种选择.
I am not with 3rd .
我想知道哪种方式最好还是有其他更好的方式?
I want to know is the best way to go or is any way?
注意:当前网站是使用 .NET 4.0/vs 2010 构建的.
Note: was .NET 4.0/ vs 2010.
谢谢
推荐答案
我使用资源文件添加 .asax 完成的示例代码
code i have done file add .asax
void Application_BeginRequest(Object sender, EventArgs e)
{
// Code that runs on application startup
HttpCookie cookie = HttpContext.Current.Request.Cookies["CultureInfo"];
if (cookie != null && cookie.Value != null)
{
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(cookie.Value);
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(cookie.Value);
}
else
{
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en");
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en");
}
}
这篇关于制作多语言网站的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持模板网!