zoukankan      html  css  js  c++  java
  • 获取在线人数 CNZZ 和 51.la

        string Cookies = string.Empty;

    /// <summary> /// 获取在线人数 (51.la统计器) /// </summary> /// <param name="siteid">站点ID</param> string TongJi_51La(string siteid) { HttpHelper http = new HttpHelper(); HttpItem item = new HttpItem() { URL = "http://www.51.la/report/1_main_online.asp?id=" + siteid, Cookie = "AJSTAT_ok_pages=1; AJSTAT_ok_times=1; ajid=lookpass%5F16680845=8444135851201a0b86b68c66ac8eabb3", ContentType = "application/x-www-form-urlencoded" }; HttpResult result = http.GetHtml(item); Match mc = Regex.Match(result.Html, "innerHTML = '(\d+)"); return mc.Groups[1].Value; } /// <summary> /// 获取在线人数 (CNZZ统计器) /// </summary> /// <param name="siteid">站点ID</param> /// <param name="pws">独立密码</param> /// <returns></returns> string TongJi_CNZZ(string siteid, string pws) { //万能框架对象 HttpHelper http = new HttpHelper(); //获取登录页面Cookie HttpItem item = new HttpItem() { URL = "http://new.cnzz.com/v1/login.php?siteid=" + siteid }; HttpResult result = http.GetHtml(item); Cookies = HttpHelper.GetSmallCookie(result.Cookie); //登录 item = new HttpItem() { URL = "http://new.cnzz.com/v1/login.php?t=login&siteid=" + siteid, Method = "POST", Postdata = "password=" + pws, Cookie = Cookies, ContentType = "application/x-www-form-urlencoded", Allowautoredirect = true, AutoRedirectCookie = true }; result = http.GetHtml(item); Cookies += HttpHelper.GetSmallCookie(result.Cookie); //获取15分钟在线IP item = new HttpItem() { URL = "http://tongji.cnzz.com/main.php?c=flow&a=realtime&ajax=module=flash&type=Pie&siteid=" + siteid, Cookie = Cookies, ContentType = "application/x-www-form-urlencoded" }; result = http.GetHtml(item); Match mc = Regex.Match(result.Html, "total_ip":(\d+)"); return mc.Groups[1].Value; }
            /// <summary>
            /// 获取在线人数 (CNZZ统计器)
            /// </summary>
            /// <param name="siteid">站点ID</param>
            /// <param name="pws">独立密码</param>
            /// <returns></returns>
            string TongJi_CNZZ(string siteid, string pws)
            {
                //万能框架对象
                HttpHelper http = new HttpHelper();
                //登录
                HttpItem item = new HttpItem()
                 {
                     URL = "http://new.cnzz.com/v1/login.php?t=login&siteid=" + siteid,
                     Method = "POST",
                     Postdata = "password=" + pws,
                     ContentType = "application/x-www-form-urlencoded",
                     Allowautoredirect = true,
                     AutoRedirectCookie = true
                 };
                HttpResult result = http.GetHtml(item);
                string Cookies = HttpHelper.GetSmallCookie(result.Cookie);
                //获取15分钟在线IP
                item = new HttpItem()
                {
                    URL = "http://tongji.cnzz.com/main.php?c=flow&a=realtime&ajax=module=flash&type=Pie&siteid=" + siteid,
                    Cookie = Cookies,
                    ContentType = "application/x-www-form-urlencoded"
                };
                result = http.GetHtml(item);
                Match mc = Regex.Match(result.Html, "total_ip":(\d+)");
                return mc.Groups[1].Value;
            }
  • 相关阅读:
    【紫光同创国产FPGA教程】【第十七章】AD实验之AD9238波形显示
    【紫光同创国产FPGA教程】【第十六章】SOBEL边缘检测例程
    【紫光同创国产FPGA教程】【第十五章】OV5640摄像头显示例程
    【紫光同创国产FPGA教程】【第十四章】SD卡读取BMP图片显示例程
    【紫光同创国产FPGA教程】【第十三章】字符显示实验
    【紫光同创国产FPGA教程】【第十二章】SD卡音乐播放例程
    【紫光同创国产FPGA教程】【第十一章】录音与播放例程
    【转载】easy-flows流程编排介绍
    【转载】分布式任务调度平台Xxl-job简介
    【转载】Apollo配置中心介绍
  • 原文地址:https://www.cnblogs.com/chengulv/p/4354229.html
Copyright © 2011-2022 走看看