Exemplo n.º 1
0
        public string GetSeenCookie(string Ip)
        {
            PersianDateTime      persianDateTime = new PersianDateTime(DateTime.Now);
            List <ExcParameters> parss           = new List <ExcParameters>();
            ExcParameters        par             = new ExcParameters
            {
                _KEY   = "@Ip",
                _VALUE = Ip
            };

            parss.Add(par);

            par = new ExcParameters
            {
                _KEY   = "@day",
                _VALUE = persianDateTime.GetDayOfYear
            };
            parss.Add(par);

            par = new ExcParameters
            {
                _KEY   = "@month",
                _VALUE = persianDateTime.GetMonthEnum(persianDateTime.GetLongMonthName)
            };
            parss.Add(par);

            par = new ExcParameters
            {
                _KEY   = "@year",
                _VALUE = persianDateTime.GetShortYear
            };
            parss.Add(par);

            base.Connect();
            string s = base.Script("INSERT INTO [tbl_SiteSeen] ([IpAddress],[Day],[Month],[Year]) VALUES(@Ip,@day,@month,@year)", parss);

            base.DC();
            if (s == "1")
            {
                var security = new Security();

                return(security.HMACMD5Generator("{ Today Seen }"));
            }
            else
            {
                return("");
            }
        }