yuesu/Global.asax
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<%@ Application Codebehind="Global.asax.cs" Inherits="Mvcb2b.MvcApplication" Language="C#" %>
<%@ Import Namespace="MvcViewEngine"%>
<script runat="server">
public override string GetVaryByCustomString(HttpContext context, string arg)
{
string cacheKey = "www";
string isResponsive = Fun.IsResponsive;
string iscity = Fun.Iscity;
switch(arg) {
case "cityen":
if (iscity == "1")
{
string HostName = HttpContext.Current.Request.Url.Host.ToString();
string[] UserHost = HostName.Split(new Char[] { '.' });
if (UserHost.Length >= 3)
{
string UserDomainName = UserHost[0].ToString();
cacheKey = UserDomainName; //这里是不同的cachekey
}
}
if (isResponsive == "1")
{
//服务器端响应,不是客户端响应
string ismobile = Fun.Ismobile.ToString();
string skin = ViewEngineExtension.GetSelectSkinName_Http(context); //手机端模板和电脑端模板不一样
cacheKey = skin + "mobile_pc_" + ismobile.ToString();
}
if (Admincookie.Getcookie("Adminuser", true) != null && Admincookie.Getcookie("Adminuser", true) != "") //global.asax不能用session
{
cacheKey = cacheKey + "_adminuserlogin";
}
if (Data.PriceType > 4)
{
//博客网站
/////////////
/*说明:博客网站不需要开启用户登录缓存*/
}
else
{
//新闻网站
if (Data.ProductType > 3) //增强版才开启登录用户和未登录用户不同缓存
{
if (Usercookie.Getcookie("user_en",true) == null || Usercookie.Getcookie("user_en",true) == "")
{
//用户未登录时,缓存一样
cacheKey = cacheKey + "_usernologin";
}
else
{
//判断用户登录看的缓存与未登录时缓存不一样
cacheKey = cacheKey + "_userlogin";
}
}
}
break;
case "ip":
cacheKey = cacheKey + "user_" + HttpContext.Current.Request.UserHostAddress;
后面还有 45 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
