Hidistro.ControlPanel/Hidistro/ControlPanel/Store/HiAffiliation.cs

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace Hidistro.ControlPanel.Store
{
    using Hidistro.Entities.Members;
    using Hidistro.SaleSystem.Vshop;
    using System;
    using System.Runtime.InteropServices;
    using System.Web;
    using System.Linq;

    public static class HiAffiliation
    {
        public static void ClearReferralIdCookie()
        {
            HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
            if (((cookie != null) && !string.IsNullOrEmpty(cookie.Value)) && (int.Parse(cookie.Value) == 0))
            {
                cookie.Value = null;
                cookie.Expires = DateTime.Now.AddYears(-1);
                HttpContext.Current.Response.Cookies.Set(cookie);
            }
        }

        public static void ClearUserCookie(string url = "", bool isRedirect = false)
        {
            HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-Member"];
            if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value))
            {
                cookie.Value = null;
                cookie.Expires = DateTime.Now.AddYears(-1);
                HttpContext.Current.Response.Cookies.Set(cookie);
                if (!(!isRedirect || string.IsNullOrEmpty(url)))
                {
                    HttpContext.Current.Response.Redirect(url);
                }
            }
        }

        public static string GetReturnUrl(string returnUrl)
        {
            if (returnUrl.IndexOf("?") > -1)
            {
                returnUrl = returnUrl.Substring(returnUrl.IndexOf("?"));
            }
            return returnUrl;
        }

        public static void LoadPage()
        {
            string str = ReturnUrl();
            if (!string.IsNullOrEmpty(str))
            {
                HttpContext.Current.Response.Redirect(str);
            }
            HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
            if ((((cookie != null) && !string.IsNullOrEmpty(cookie.Value)) && (int.Parse(cookie.Value) != 0)) && (DistributorsBrower.GetCurrentDistributors(Convert.ToInt32(cookie.Value)) == null))
            {
                ClearReferralIdCookie();
                ClearUserCookie("/UserLogin.aspx", true);
            }
        }
后面还有 162 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。