Example #1
0
        public static Hashtable GetPara(string strParament)
        {
            if (strParament == null || strParament.IndexOf("=") == -1)
            {
                return(null);
            }
            else if (!StringItem.IsSafeWordPara(strParament))
            {
                return(null);
            }

            Hashtable htPara = new Hashtable();

            Cuter cPara = StringItem.GetWebServiceArgument(strParament);

            string[] strParaments = cPara.GetArrCuter();
            foreach (string strPara in strParaments)
            {
                if (strPara.IndexOf("=") != -1)
                {
                    Cuter       cP = new Cuter(strPara, "=");
                    HttpContext hc = HttpContext.Current;
                    try
                    {
                        htPara.Add(cP.GetCuter(0), hc.Server.UrlDecode(cP.GetCuter(1)));
                    }
                    catch
                    {}
                }
            }

            return(htPara);
        }
Example #2
0
        /// <summary>
        /// 方法:  JumpToTargetPage
        /// 功能:  跳转到目标页。
        ///         要求必须有JumpPage的URL参数。
        /// 作者:  齐玮
        /// 修改:
        /// 时间:  2007-2-2 17:41
        /// </summary>
        public static void JumpToTargetPage()
        {
            string strJumpPage = (string)SessionItem.GetRequest("JumpPage", 1);

            //?:!    ^:&    .:=
            if (strJumpPage.IndexOf("!") != -1)
            {
                strJumpPage = strJumpPage.Replace("!", ",");
                Cuter  cuterJumpPage = new Cuter(strJumpPage);
                string strJumpPage1  = cuterJumpPage.GetCuter(0);
                string strJumpPage2  = cuterJumpPage.GetCuter(1).Replace("^", "&").Replace(".", "=");
                strJumpPage = strJumpPage1 + "?" + strJumpPage2;
            }
            strJumpPage = strJumpPage.Replace("/", "");
            HttpContext hc = HttpContext.Current;

            hc.Response.Redirect(strJumpPage);
        }
Example #3
0
        /// <summary>
        /// 方法:  JumpToResponseCookiePage
        /// 功能:  在主站判断已经存在登录信息,跳转到向分站请求Cookie的页面。
        ///         要求必须有JumpPage、NeedLogin的URL参数。
        /// 作者:  齐玮
        /// 修改:
        /// 时间:  2007-2-2 16:09
        /// </summary>
        /// <param name="intUserID">Cookie中的UserID</param>
        /// <param name="intReportParameter">错误报告所需要的参数</param>
        public static void JumpToResponseCookiePage(int intUserID, int intReportParameter)
        {
            string strJumpURL   = ((string)SessionItem.GetRequest("JumpPage", 1)).ToLower(); //获得页面的来路并且将来路变为小写
            int    intNeedLogin = (int)SessionItem.GetRequest("NeedLogin", 0);

            //?:!    ^:&    .:=
            strJumpURL = strJumpURL.Replace("http://", "").Replace("?", "!").Replace("&", "^").Replace("=", ".");

            Cuter cuter = new Cuter(strJumpURL, "/");

            string strDomain;

            if (DBConnection.IsOnline)
            {
                strDomain = cuter.GetCuter(0);
            }
            else
            {
                strDomain = cuter.GetCuter(0);// +"/" + cuter.GetCuter(1); //两个GetCuter是因为这是在本地,如果传入服务器,只需要1个GetCuter了。
            }
            string strJumpPage = strJumpURL.Replace(strDomain, "");

            if (intUserID > 0)
            {
                string strUserID = StringItem.MD5Encrypt(intUserID.ToString().Trim(), "x1~baK07").ToString().Trim();
                strJumpURL = "http://" + strDomain + "/ResponseCookiePage.aspx?CheckCookie=true&UserID=" + strUserID + "&JumpPage=" + strJumpPage;
            }
            else
            {
                if (intNeedLogin == 0)
                {
                    strJumpURL = "http://" + strDomain + "/ResponseCookiePage.aspx?CheckCookie=false&JumpPage=" + strJumpPage;
                }
                else
                {
                    strJumpURL = "Report.aspx?Parameter=" + intReportParameter;
                }
            }

            HttpContext hc = HttpContext.Current;

            hc.Response.Redirect(strJumpURL);
        }