Ejemplo n.º 1
0
        private void MSGAdd()
        {
            result = "0";

            if (!SessionAllow("addmsg", 3))
            {
                result = "消息发送太快!";
            }
            else
            {
                try
                {
                    string note     = GSSRequest.GetString("note");
                    string gamedata = GSSRequest.GetString("r");

                    ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
                    result         = ws.GSSMSGAdd(note, gamedata);
                }
                catch (System.Exception ex)
                {
                    result = "LINK GSSSERVER ERROR";
                }
            }

            System.Text.StringBuilder xmlnode = new System.Text.StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
            ResponseXML(xmlnode.AppendFormat("<result>{0}</result>", result));
        }
Ejemplo n.º 2
0
        private void AddAnswer()
        {
            if (!SessionAllow("addanswer", 30))
            {
                result = "30秒内只允许提交一次,请稍候再试!";
            }
            else
            {
                try
                {
                    string gdata  = GSSRequest.GetString("r");
                    string answer = GSSRequest.GetString("as");

                    ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
                    result         = ws.GSSTaskAddRequst(gdata, answer);
                }
                catch (System.Exception ex)
                {
                    result = "LINK GSSSERVER ERROR";
                }
            }

            System.Text.StringBuilder xmlnode = new System.Text.StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
            ResponseXML(xmlnode.AppendFormat("<result>{0}</result>", result));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //Request.ContentEncoding = System.Text.Encoding.GetEncoding("gbk");


            try
            {
                string p = GSSRequest.GetString("r");
                if (string.IsNullOrEmpty(p))
                {
                    return;
                }
                string[] paramrs = GSSRequest.GetString("r").Split('|');
                string   p1      = Utils.MD5(paramrs[1]).Substring(27);
                if (p1 != paramrs[0])
                {
                    Response.Clear();
                    Response.End();
                    return;
                }
                maxuploadlength = Utils.GetMaxUpContentLength();
                overtime        = Convert.ToInt32(Utils.GetMaxUpOverTime() * 1000);


                paramrStr  = Request["r"] == null ? "" : Request["r"].ToString();
                paramrStr += ";ClientIP:" + GSSRequest.GetIP4Address();
            }
            catch (Exception ex)
            {
                Response.Clear();
                Response.End();
                return;
            }
        }
Ejemplo n.º 4
0
 public Ajax()
 {
     if (Utils.StrIsNullOrEmpty(GSSRequest.GetUrlReferrer()))
     {
         return;
     }
     else if (GSSRequest.IsCrossSitePost(GSSRequest.GetUrlReferrer(), GSSRequest.GetHost())) //如果是跨站提交...
     {
         return;
     }
 }
Ejemplo n.º 5
0
        private void AddTask()
        {
            string vercode = GSSRequest.GetString("vercode");

            if (Session["vercode"] == null || vercode != Session["vercode"].ToString())
            {
                result = "验证码不正确或失效,请重新输入!";
            }
            else
            {
                if (!SessionAllow("addtask", 30))
                {
                    result = "30秒内只允许提交一次,请稍候再试!";
                }
                else
                {
                    try
                    {
                        string type     = GSSRequest.GetString("type");
                        string note     = GSSRequest.GetString("note");
                        string qq       = GSSRequest.GetString("qq");
                        string mobile   = GSSRequest.GetString("mobile");
                        string gamedata = GSSRequest.GetString("r");
                        string upfile   = GSSRequest.GetString("f");

                        ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
                        result         = ws.GSSTaskAdd(type, note, qq, mobile, gamedata, upfile);
                    }
                    catch (System.Exception ex)
                    {
                        result = "LINK GSSSERVER ERROR";
                    }
                }
            }

            Session["vercode"] = null;

            System.Text.StringBuilder xmlnode = new System.Text.StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
            ResponseXML(xmlnode.AppendFormat("<result>{0}</result>", result));
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = GSSRequest.GetString("t");

            switch (type)
            {
            case "addtask":
                AddTask();        //提交工单
                break;

            case "addanswer":
                AddAnswer();        //问卷调查
                break;

            case "msgadd":
                MSGAdd();        //提交工单
                break;

            case "msglist":
                MSGList();        //列取工单
                break;
            }
        }
Ejemplo n.º 7
0
        private void MSGList()
        {
            result = "0";
            if (!SessionAllow("listmsg", 1))
            {
                result = "0";//返回正常
            }
            else
            {
                try
                {
                    string roleid = GSSRequest.GetString("roleid");

                    ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
                    DataSet ds = ws.GSSMSGList(roleid);

                    if (ds != null)
                    {
                        result = "";
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            string note  = dr["F_Note"].ToString().Replace("\n", "<br />");
                            string tuser = dr["F_EditMan"].ToString().PadLeft(4, '0');
                            string time  = dr["F_EditTime"].ToString();

                            if (note.IndexOf("【游戏数据】") == -1)
                            {
                                string info = "";
                                if (tuser == "0000")
                                {
                                    tuser = dr["F_GRoleName"].ToString();
                                    info  = string.Format("<font color=#0078c9>{0}</font> <font color=gray>{1}</font><br/>{2}<br/>", tuser, time, note);
                                }
                                else
                                {
                                    tuser = "******" + tuser + " ";
                                    info  = string.Format("<font color=#e81e75>{0}</font> <font color=gray>{1}</font><br/>{2}<br/>", tuser, time, note);
                                }

                                result += Server.HtmlEncode(info);
                            }
                        }
                        if (result == "")
                        {
                            result = "0";
                        }
                    }
                    else
                    {
                        result = "0";//返回正常
                    }
                }
                catch (System.Exception ex)
                {
                    result = "0";
                }

                System.Text.StringBuilder xmlnode = new System.Text.StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
                ResponseXML(xmlnode.AppendFormat("<result>{0}</result>", result));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Utils.StrIsNullOrEmpty(GSSRequest.GetUrlReferrer()))//上一页面是否空
            {
                return;
            }
            else if (!CheckRealm(Utils.GetCountStatRealm(), GSSRequest.GetUrlReferrer()))//是否需要统计的域名
            {
                return;
            }
            //else if(Utils.StrIsNullOrEmpty(GSSRequest.GetString("s")))
            //    return;
            NowURL = this.Request.Url.ToString();
            if (NowURL.IndexOf("&w=") != -1)
            {
                NowURL = NowURL.Remove(NowURL.IndexOf("&w="));
            }
            //参数检测
            string game    = GSSRequest.GetString("game");
            string type    = GSSRequest.GetString("type");
            string swidth  = GSSRequest.GetString("w").Trim();
            string sheight = GSSRequest.GetString("h").Trim();

            if (!CheckGame(game))
            {
                return;
            }
            else if (!CheckType(type))
            {
                return;
            }



            if (swidth.Length != 0)
            {
                if (!SessionAllow(game + "-" + type))//是否可以计数
                {
                    return;
                }
                GSSGameWeb.WebServiceGSS.CountDetail model = new GSSGameWeb.WebServiceGSS.CountDetail();
                System.Collections.Specialized.NameValueCollection ServerVariables = System.Web.HttpContext.Current.Request.ServerVariables;
                //IP
                model.IP = ServerVariables["REMOTE_ADDR"].ToString();
                //来路
                string referer = GSSRequest.GetUrlReferrer();
                if (referer.Length > 150)
                {
                    referer = referer.Substring(0, 150);
                }
                model.Page = referer;

                //客户端软件使用情况
                string useragent = ServerVariables["HTTP_USER_AGENT"].ToString();

                //浏览器
                model.IESoft      = "Other";
                string[,] arvsoft = new string[, ] {
                    { "NetCaptor", "NetCaptor" }, { "MSIE 11", "MSIE 11.x" }, { "MSIE 10", "MSIE 10.x" }, { "MSIE 9", "MSIE 9.x" }, { "MSIE 8", "MSIE 8.x" }, { "MSIE 7", "MSIE 7.x" }, { "MSIE 6", "MSIE 6.x" }, { "MSIE 5", "MSIE 5.x" }, { "MSIE 4", "MSIE 4.x" }, { "Netscape", "Netscape" }, { "Opera", "Opera" }, { "Chrome", "Chrome" }
                };
                for (int i = 0; i < arvsoft.Length; i++)
                {
                    if (useragent.IndexOf(arvsoft[i, 0].ToString()) > 0)
                    {
                        model.IESoft = arvsoft[i, 1];
                        break;
                    }
                }

                //操作系统
                model.OS        = "Other";
                string[,] arvos = new string[, ] {
                    { "Windows NT 5.0", "Win2k" }, { "Windows NT 5.1", "WinXP" }, { "Windows NT 5.2", "Win2k3" }, { "Windows NT 6.0", "WinVista" }, { "Windows NT 6.1", "Win7" }, { "Windows NT 6.2", "Win8" }, { "Windows NT", "WinNT" }, { "Windows 9", "Win9x" }, { "unix", "Unix's" }, { "linux", "Unix's" }, { "SunOS", "Unix's" }, { "BSD", "Unix's" }, { "Mac", "Mac" }
                };
                for (int i = 0; i < arvos.Length; i++)
                {
                    if (useragent.IndexOf(arvos[i, 0].ToString()) > 0)
                    {
                        model.OS = arvos[i, 1];
                        break;
                    }
                }
                model.CLR      = Request.Browser.ClrVersion.ToString();
                model.Language = Request.UserLanguages[0];
                model.WinBit   = Request.Browser.Win32 ? "WIN32" : (Request.Browser.Win16 ? "WIN16" : "OTHER");

                model.Year         = DateTime.Now.Year;
                model.Month        = DateTime.Now.Month;
                model.Day          = DateTime.Now.Day;
                model.Hour         = DateTime.Now.Hour;
                model.Game         = int.Parse(game);
                model.Type         = int.Parse(type);
                model.Time         = DateTime.Now;
                model.Screenwidth  = int.Parse(swidth);
                model.Screenheight = int.Parse(sheight);

                WebServiceGSS.WebServiceGSS ws = new WebServiceGSS.WebServiceGSS();
                ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
                ws.GSSCountDetailAdd(model);
            }
        }