示例#1
0
        public string[] getRequest()
        {
            string str = "";

            byte[]   numArray  = new byte[4096];
            string[] strArray1 = new string[4096];
            int      count;

            while ((count = this._networkStream.Read(numArray, 0, numArray.Length)) > 0)
            {
                str = str + Encoding.ASCII.GetString(numArray, 0, count);
                if (str.IndexOf("\r\n\r\n") >= 0 || str.Length > 4096)
                {
                    break;
                }
            }
            Match match = Regex.Match(str, "^\\w+\\s+([^\\s\\?]+)[^\\s]*\\s+HTTP/.*|");

            if (match == Match.Empty)
            {
                strArray1[0] = "";
                return(strArray1);
            }
            else
            {
                strArray1[0] = match.Groups[1].Value;
                strArray1[0] = Uri.UnescapeDataString(strArray1[0]);
                string[] accInfo    = Utilits.getAccInfo(str);
                string   cookieAuth = Utilits.getCookieAuth(str);
                string   loginWeb   = Utilits.getLoginWeb(str);
                strArray1[1] = accInfo[0];
                strArray1[2] = accInfo[1];
                strArray1[3] = cookieAuth;
                strArray1[4] = loginWeb;
                string[] strArray2 = str.Split(new string[1]
                {
                    "players="
                }, StringSplitOptions.None);
                if (strArray2.Length > 1)
                {
                    string[] strArray3 = strArray2[1].Split(new string[1]
                    {
                        "\r\n"
                    }, StringSplitOptions.None)[0].Split(new string[1]
                    {
                        "%0D%0A"
                    }, StringSplitOptions.None);
                    for (int index = 0; index < strArray3.Length; ++index)
                    {
                        strArray1[6 + index] = strArray3[index];
                    }
                    strArray1[5] = strArray3.Length.ToString();
                }
                if (strArray1[0].IndexOf("..") >= 0)
                {
                    return(strArray1);
                }
                CLogger.getInstance().info("GET " + strArray1[0]);
                return(strArray1);
            }
        }
示例#2
0
        public string[] getRequest()
        {
            string text = "";

            byte[]   array  = new byte[4096];
            string[] array2 = new string[4096];
            int      count;

            while ((count = this._networkStream.Read(array, 0, array.Length)) > 0)
            {
                text += Encoding.ASCII.GetString(array, 0, count);
                bool flag = text.IndexOf("\r\n\r\n") >= 0 || text.Length > 4096;
                if (flag)
                {
                    break;
                }
            }
            Match match = Regex.Match(text, "^\\w+\\s+([^\\s\\?]+)[^\\s]*\\s+HTTP/.*|");
            bool  flag2 = match == Match.Empty;

            string[] result;
            if (flag2)
            {
                array2[0] = "";
                result    = array2;
            }
            else
            {
                array2[0] = match.Groups[1].Value;
                array2[0] = Uri.UnescapeDataString(array2[0]);
                string[] accInfo    = Utilits.getAccInfo(text);
                string   cookieAuth = Utilits.getCookieAuth(text);
                string   loginWeb   = Utilits.getLoginWeb(text);
                array2[1] = accInfo[0];
                array2[2] = accInfo[1];
                array2[3] = cookieAuth;
                array2[4] = loginWeb;
                string[] array3 = text.Split(new string[]
                {
                    "players="
                }, StringSplitOptions.None);
                bool flag3 = array3.Length > 1;
                if (flag3)
                {
                    string[] array4 = array3[1].Split(new string[]
                    {
                        "\r\n"
                    }, StringSplitOptions.None)[0].Split(new string[]
                    {
                        "%0D%0A"
                    }, StringSplitOptions.None);
                    for (int i = 0; i < array4.Length; i++)
                    {
                        array2[6 + i] = array4[i];
                    }
                    array2[5] = array4.Length.ToString();
                }
                bool flag4 = array2[0].IndexOf("..") < 0;
                if (flag4)
                {
                    CLogger.getInstance().info("GET " + array2[0]);
                }
                result = array2;
            }
            return(result);
        }