Exemplo n.º 1
0
        static int GetUpCom_Content(ref char[] c_buff, int s, List <UpContent> luc)
        {
            int       e  = FindCharArray(ref c_buff, ref Key_p_e, s);
            UpContent uc = new UpContent();

            for (int i = 0; i < 40; i++)
            {
                char[] tt = FindCharArrayA(ref c_buff, '>', '<', ref s);
                if (s > e - 10)
                {
                    return(e);
                }
                if (tt != null)
                {
                    uc.text    = GetCharArray16A(ref tt);
                    uc.type    = 't';
                    uc.content = null;
                    luc.Add(uc);
                }
                s++;
                if (c_buff[s] == 'i')//<img
                {
                    tt = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                    tt = DeleteChar(ref tt, '\\');
                    if (tt[0] != 'h')
                    {
                        uc.content = "http:" + new string(tt);
                    }
                    else
                    {
                        uc.content = new string(tt);
                    }
                    uc.type  = 'i';
                    s        = FindCharArray(ref c_buff, ref Key_data_width, s);
                    tt       = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                    uc.width = CharToInt(ref tt);
                    s++;
                    tt        = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                    uc.height = CharToInt(ref tt);
                    luc.Add(uc);
                }
            }
            return(e);
        }
Exemplo n.º 2
0
        public static int AnalyUpComment(ref char[] c_buff, List <UpCommentInfo> luc)
        {
            int           s = 0, ss = luc.Count;
            UpCommentInfo ci = new UpCommentInfo();
            int           i, rid = ss;

            for (i = 0; i < 10; i++)
            {
                s = FindCharArray(ref c_buff, ref Key_js_id, s);//id
                if (s < 0)
                {
                    break;
                }
                ci.m_id = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref s));
                int r = FindCharArray(ref c_buff, ref Key_js_rootid, s, s + 20);//rootid
                if (r > 0)
                {
                    ci.m_r_id = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref r));
                    ci.rid    = rid;
                    s         = r;
                }
                else
                {
                    ci.m_r_id = null; rid = i + ss;
                };

                s       = FindCharArray(ref c_buff, ref Key_js_userid, s);//userid
                ci.u_id = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref s));

                s = FindCharArray(ref c_buff, ref Key_up, s);//up
                char[] tt = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                ci.approval = CharToInt(ref tt);
                string str = "(" + new string(tt) + ")赞 (";

                s          = FindCharArray(ref c_buff, ref Key_poke, s);//poke
                tt         = FindCharArrayA(ref c_buff, ':', ',', ref s);
                ci.against = CharToInt(ref tt);
                str       += new string(tt) + ")反对 (";

                s         = FindCharArray(ref c_buff, ref Key_rep, s);//rep
                tt        = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                ci.replay = CharToInt(ref tt);
                str      += new string(tt) + ")回复";
                ci.count  = str;

                s        = FindCharArray(ref c_buff, ref Key_titleB, s);//title
                tt       = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                ci.title = GetString16A(ref tt);

                s           = FindCharArray(ref c_buff, ':', s);
                tt          = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                s           = FindCharArray(ref c_buff, ref Key_content, s);//content
                ci.detail_s = new List <UpContent>();
                int o = GetUpCom_Content(ref c_buff, s, ci.detail_s);
                if (o > 0)
                {
                    s = o;
                }
                if (ci.detail_s.Count == 0)
                {
                    UpContent u = new UpContent();
                    tt     = GetCharArray16A(ref tt);
                    u.text = tt;
                    u.type = 't';
                    ci.detail_s.Add(u);
                }

                s       = FindCharArray(ref c_buff, ref Key_js_timeD, s);//timeDifference
                tt      = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                ci.time = GetString16A(ref tt);

                s       = FindCharArray(ref c_buff, ref Key_js_nick, s);//nick
                tt      = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                ci.nick = GetString16(ref tt);

                s = FindCharArray(ref c_buff, ref Key_js_head, s);//head
                int t = s;
                tt = FindCharArrayA(ref c_buff, '\"', '\"', ref t);
                if (tt != null)
                {
                    ci.url = new string(DeleteChar(ref tt, '\\'));
                }

                s         = FindCharArray(ref c_buff, ref Key_js_region, s);//region
                tt        = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                ci.region = GetString16(ref tt);

                s      = FindCharArray(ref c_buff, ref Key_js_vip, s);//viptype
                ci.vip = new string(FindCharArrayA(ref c_buff, ':', ',', ref s));

                s        = FindCharArray(ref c_buff, ref Key_score, s);//score
                tt       = FindCharArrayA(ref c_buff, ':', ',', ref s);
                ci.score = CharToInt(ref tt);

                luc.Add(ci);
            }
            return(i);
        }