先写资源文件,放在App_GlobalResources文件下面。
<asp:Label ID="Label10" runat="server" Text="<%$ Resources:lang,aboutus%>"></asp:Label>
进行绑定,在Global.asax文件里写入cookieC# code void Application_BeginRequest(object sender, EventArgs e)
{
try
{
if (Request.Cookies["lang"] != null)
{
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(Request.Cookies["lang"].Value.ToString());
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(Request.Cookies["lang"].Value.ToString());
}
}
catch (Exception)
{ }
}
<asp:Label ID="Label10" runat="server" Text="<%$ Resources:lang,aboutus%>"></asp:Label>
进行绑定,在Global.asax文件里写入cookieC# code void Application_BeginRequest(object sender, EventArgs e)
{
try
{
if (Request.Cookies["lang"] != null)
{
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(Request.Cookies["lang"].Value.ToString());
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(Request.Cookies["lang"].Value.ToString());
}
}
catch (Exception)
{ }
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货