Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            System.Collections.Specialized.NameValueCollection s = Request.QueryString;

            if (s.Count != 1)
            {
                return;
            }
            string query = HttpUtility.UrlDecode(s.ToString());

            if (query.Contains("id=") && query.Contains("url="))
            {
                string date = DateTime.Now.ToString("yyyyMMdd");
                Guid   id;
                try
                {
                    id = new Guid(query.Substring(query.IndexOf("=") + 1, query.IndexOf("&") - 3));
                }
                catch
                {
                    return;
                }
                int type = string.IsNullOrEmpty(Request.QueryString["type"]) ? 1 : 0;

                ClickInfo info = new ClickInfo();
                info.ClickType = type;
                info.ClickDate = date;
                info.UserAdsId = id;

                if (ClickService.SelectHasCount(info))
                {
                    ClickService.UpdateClickInfo(info);
                }
                else
                {
                    info.ClickCount = 1;
                    ClickService.InsertClickInfo(info);
                }

                string url = query.Substring(query.IndexOf("url=") + 4);
                url = url.Contains("?") ? url + "&" : url + "?";

                Response.Write(@"<script language='javascript' type='text/javascript'  src='http://js.users.51.la/12120626.js'></script><script>if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
var referLink=document.createElement('a');
referLink.href='" + url + "spm=2018.12167184.0.0';document.body.appendChild(referLink);referLink.click();}else{location.href='" + url + "spm=2018.12167184.0.0';}</script>");
            }
        }
    }
Exemplo n.º 2
0
    private void ShowChart(string start, string end, UserAdsInfo info)
    {
        string            id   = Request.QueryString["id"];
        IList <ClickInfo> list = new ClickService().SelectAllClickCount(new Guid(id), start, end);

        SeriseText = "[{name:'点击量', data:[";
        DateText   = "[";
        for (DateTime h = DateTime.Parse(DateTime.Now.AddDays(-14).ToShortDateString()); h <= DateTime.Parse(DateTime.Now.ToShortDateString()); h = h.AddDays(1))
        {
            DateText += "'" + h.Day + "',";
            IList <ClickInfo> thisInfo = list.Where(o => o.ClickDate == h.ToString("yyyyMMdd")).ToList();


            if (thisInfo.Count == 0)
            {
                if (DateTime.Parse(info.AddTime.ToShortDateString()) <= h)
                {
                    SeriseText += "1,";
                }
                else
                {
                    SeriseText += "0,";
                }
            }
            else
            {
                if (thisInfo[0].ClickCount == 0)
                {
                    if (DateTime.Parse(info.AddTime.ToShortDateString()) <= h)
                    {
                        SeriseText += "1,";
                    }
                    else
                    {
                        SeriseText += thisInfo[0].ClickCount + ",";
                    }
                }
                else
                {
                    SeriseText += thisInfo[0].ClickCount + ",";
                }
            }
        }
        SeriseText  = SeriseText.Substring(0, SeriseText.Length - 1);
        SeriseText += "]}]";

        DateText  = DateText.Substring(0, DateText.Length - 1);
        DateText += "]";
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            System.Collections.Specialized.NameValueCollection s = Request.QueryString;

            if (s.Count != 1)
            {
                return;
            }
            string query = HttpUtility.UrlDecode(s.ToString());

            if (query.Contains("id=") && query.Contains("url="))
            {
                string date = DateTime.Now.ToString("yyyyMMdd");
                Guid   id;
                try
                {
                    id = new Guid(query.Substring(query.IndexOf("=") + 1, query.IndexOf("&") - 3));
                }
                catch
                {
                    return;
                }
                int type = string.IsNullOrEmpty(Request.QueryString["type"]) ? 1 : 0;

                ClickInfo info = new ClickInfo();
                info.ClickType = type;
                info.ClickDate = date;
                info.UserAdsId = id;

                if (ClickService.SelectHasCount(info))
                {
                    ClickService.UpdateClickInfo(info);
                }
                else
                {
                    info.ClickCount = 1;
                    ClickService.InsertClickInfo(info);
                }

                string url = query.Substring(query.IndexOf("url=") + 4);
                url = url.Contains("?") ? url + "&" : url + "?";

                Response.Redirect(url);
            }
        }
    }
Exemplo n.º 4
0
 public void Initialize()
 {
     ClickService = new ClickService();
     ClickService.Initialize();
     MovementDirectionService = new MovementDirectionService();
     MovementDirectionService.Initialize();
     GameStateService = new GameStateService();
     GameStateService.Initialize();
     CollectedCrystalsCountingService = new CollectedCrystalsCountingService();
     CollectedCrystalsCountingService.Initialize();
     // UserInterfaceManager needs CollectedCrystalsCountingService
     UserInterfaceManager.Initialize();
     MovementSpeedService = new MovementSpeedService();
     MovementSpeedService.Initialize();
     // GameObjectsManager needs GameStateService
     RandomFiledGenerationService = new RandomFiledGenerationService();
     RandomFiledGenerationService.Initialize();
     // GameObjectsManager needs RandomFieldGenerationService
     GameObjectsManager.Initialize();
 }
 protected override void ExecuteClick()
 => ClickService.RestartVisualStudio(confirm: true, elevated: false);
 protected override void ExecuteClick()
 => ClickService.CreateNewProject();
Exemplo n.º 7
0
 protected override void ExecuteClick()
 => ClickService.CloneRepository();
 protected override void ExecuteClick()
 => ClickService.OpenFolder();
 protected override void ExecuteClick()
 => ClickService.OpenProject();