WebUI/AdminM/Sys/GetCategory.aspx.cs

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HtmlAgilityPack;
using System.Text;
using HModel;
using Bll;

namespace WebUI.AdminM.Sys
{
    public partial class GetCategory : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

             

            string url = "http://b2b.huangye88.com/hubei/";

            HtmlWeb hweb = new HtmlWeb();
            hweb.OverrideEncoding = Encoding.GetEncoding("utf-8");
            HtmlDocument hdoc = hweb.Load(url);

            //0 1 2 3
            HtmlNode hnc = hdoc.GetElementbyId("subcatlisting_10"); // [0].SelectNodes("ul")[0].SelectNodes("li");

            string h = "", h2 = "" ;
            try
            {
                HtmlNodeCollection hncoll = hnc.SelectNodes("ul/li");

                foreach (HtmlNode hn in hncoll)
                {
                    string a = hn.SelectNodes("a")[0].InnerHtml.Replace("湖北", "").Replace("企业名录", "");
                    string href = hn.SelectNodes("a")[0].Attributes["href"].Value;

                    //修改
                   ek_dictionary com = Bll.Bll_ek_dictionary.GetEntityByWhere(ek_dictionary._.title == a);
                     
                   if (com != null)
                   { 
                       com.Attach();
                       com.content = href;
                    //   int c = Bll_ek_dictionary.UpdateEntity(com);

                       
                   }
                    #region 第二层

                    HtmlWeb hweb2 = new HtmlWeb();
                    hweb2.OverrideEncoding = Encoding.GetEncoding("utf-8");
                    HtmlDocument hdoc2 = hweb2.Load(href);

                    try
                    {


后面还有 146 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。