Пример #1
0
        /// <summary>
        /// 资源编录列表-配置信息
        /// </summary>
        /// <param name="strLoginUrl"></param>
        /// <param name="strTargerUrl2"></param>
        public DataTable GetHtmlSourceListPZ(string strTargerUrl)
        {
            DataTable data       = new DataTable();
            string    strContent = Tool.ReadHTML(strTargerUrl);

            if (!string.IsNullOrEmpty(strContent))
            {
                ConvertPZ convertPZ = new ConvertPZ();
                var       dataList  = convertPZ.getListPZ(strContent);

                //按时间返回信息
                if (!string.IsNullOrEmpty(param))
                {
                    data = dataList.Clone();
                    DataRow[] drs = dataList.Select(param);
                    if (drs != null && drs.Count() > 0)
                    {
                        data = drs.CopyToDataTable();
                    }
                }
                else
                {
                    data = dataList;
                }
            }
            return(data);
        }
Пример #2
0
        /// <summary>
        /// 资源编录列表-配置信息
        /// </summary>
        public void GetHtmlSourceListPZ()
        {
            ConvertPZ convertPZ = new ConvertPZ();
            int       pageNum   = 1;

            while (true)
            {
                string strTargerUrl = string.Format("http://resource.autoidc.cn/pages/list.aspx?RESOURCEKEY=PZ&PAGEID={0}", pageNum);
                string strContex    = ReadHTML(strTargerUrl);
                var    num          = convertPZ.getPageNumHGZ(strContex);
                var    data         = convertPZ.getListPZ(strContex);
                LogManager.Log("MainLog", "PZ", pageNum.ToString());
                //InsertPZ insertPZ = new InsertPZ();
                //insertPZ.InsertListPZ(data);
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    // 资源明细-机动车合格证申请界面
                    string strTargerUrlDetailsPZ = string.Format("http://resource.autoidc.cn/pages/details.aspx?RESOURCEKEY=PZ&RESOURCEID={0}", data.Rows[i]["PZXLH"]);
                    GetHtmlSourceDetailsPZ(strTargerUrlDetailsPZ);
                    LogManager.Log("MainLog", "PZ", data.Rows[i]["PZXLH"].ToString());
                }
                pageNum++;
                if (num == pageNum)
                {
                    break;
                }
            }
        }