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");
}
}
這篇關于制作多語言網站的最佳方式的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持模板網!