Beispiel #1
0
 /// <summary>
 /// AppStore跳转地址编码
 /// </summary>
 public void AppStoreUrlEncode()
 {
     if (LinkType == 1)
     {
         string appid       = net91com.Core.Util.CryptoHelper.DES_Encrypt(SoftID.ToString(), "91appuse");
         string appStoreUrl = System.Web.HttpUtility.UrlEncode(LinkUrl.Trim());
         string channel     = net91com.Stat.Core.UtilHelper.EncryptDES(Channel, "5a@4a$0e", "e2Eb9A82");
         LinkUrl = string.Format(@"http://funcstatic.sj.91.com/link.ashx?id={0}&mt={1}&v={2}&chl={3}&url={4}",
                                 appid, Platform, AppVersion.Trim(), channel, appStoreUrl);
     }
     if (ID == 0 && string.IsNullOrEmpty(LinkTag))
     {
         LinkTag = net91com.Stat.Core.UtilHelper.ShortUrl(SoftID + "_" + Platform + "_" + DateTime.Now.Ticks)[0];
     }
 }
Beispiel #2
0
        List <LogAssociation> FindLinkClickAssociations(Session MainLog, List <Session> SessionList, RefererAssociationType RefAssoType)
        {
            List <LogAssociation> Associations = new List <LogAssociation>();

            if (MainLog.Response == null)
            {
                return(Associations);
            }

            //Match link urls with absolute match
            foreach (string LinkUrl in MainLog.Response.Html.GetDecodedValues("a", "href"))
            {
                try
                {
                    Request LinkReq = new Request(LinkUrl.Trim());
                    foreach (Session Sess in SessionList)
                    {
                        if (!Sess.Request.Method.Equals("GET", StringComparison.OrdinalIgnoreCase))
                        {
                            continue;
                        }
                        if (Sess.Request.FullUrl.Equals(LinkReq.FullUrl) && Sess.Response != null)
                        {
                            LogAssociation LogAsso = new LogAssociation(LogAssociationType.LinkClick, RefAssoType, IronHtml.UrlInHtmlMatch.FullAbsolute, LogAssociationMatchLevel.UrlMatchOnly, MainLog, Sess);
                            Associations.Add(LogAsso);
                        }
                    }
                }
                catch
                {
                    Request LinkReq = new Request(MainLog.Request.RelativeUrlToAbsoluteUrl(LinkUrl.Trim()));
                    foreach (Session Sess in SessionList)
                    {
                        if (!Sess.Request.Method.Equals("GET", StringComparison.OrdinalIgnoreCase))
                        {
                            continue;
                        }
                        if (Sess.Request.FullUrl.Equals(LinkReq.FullUrl) && Sess.Response != null)
                        {
                            LogAssociation LogAsso = new LogAssociation(LogAssociationType.LinkClick, RefAssoType, IronHtml.UrlInHtmlMatch.FullRelative, LogAssociationMatchLevel.UrlMatchOnly, MainLog, Sess);
                            Associations.Add(LogAsso);
                        }
                    }
                }
            }
            return(Associations);
        }