Categories


Tags


抢先式多线程网络蜘蛛

  抢先式多线程网络蜘蛛

整理自网络ChatGPT产生之内容,文本内容不具备参考意义,程序内容及代码片段有且仅有借鉴意义。

  框架
//      Copyright(C) 2017 铭飞科技
//
#region 版权信息
/*
 * 此文件自 Copyright(C) 2008 - 2017 铭飞科技 Classification:无 开源网站:http://www.http://www. coding
 */
#endregion


using System;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;


namespace Web.Templates.UI
{
    /// 
    /// 标签树控件
    /// 
    public class Tree : System.Web.UI.WebControls.TreeView
    {
        private string _styleName = "";

        /// 
        /// 样式
        /// 
        /// The name of the style.
        public string StyleName
        {
            get { return _styleName; }
            set { _styleName = value; }
        }

        private string _checkedValue = "";

        /// 
        /// 默认选中当前值
        /// 
        /// The checked value.
        public string CheckedValue
        {
            get { return _checkedValue; }
            set { _checkedValue = value; }
        }

        private string _checkBoxName = "";

        /// 
        /// 复选框名称
        /// 
        /// The check box name.
        public string CheckBoxName
        {
            get { return _checkBoxName; }
            set { _checkBoxName = value; }
        }

        private int _checkParentType = -1;

        /// 
        /// 
        /// 
        /// The type of the check parent.
        public int CheckParentType
        {
            get { return _checkParentType; }
            set { _checkParentType = value; }
        }

        private int _checkChildType = -1;

        /// 
        /// 
        /// 
        /// The type of the check child.
        public int CheckChildType
        {
            get { return _checkChildType; }
            set { _checkChildType = value; }
        }

        private string _showLevel = "999";

        /// 
        /// 显示层级
        /// 
        /// The show level.
        public string ShowLevel
        {
            get { return _showLevel; }
            set { _showLevel = value; }
        }

        private string _valueField = "id";

        /// 
        /// 编号字段名
        /// 
        /// The value field.
        public string ValueField
        {
            get { return _valueField; }
            set { _valueField = value; }
        }

        private string _textField = "title";

        /// 
        /// 显示字段名
        /// 
        /// The text field.
        public string TextField
        {
            get { return _textField; }
            set { _textField = value; }
        }

        private string _fatherField = "parentid";

        /// 
        /// 父编号字段名
        /// 
        /// The father field.
        public string FatherField
        {
            get { return _fatherField; }
            set { _fatherField = value; }
        }

        private TreeNodeBindEventHandler _onBind;

        /// 
        /// 构建事件
        /// 
        /// The on bind event.
        public event TreeNodeBindEventHandler OnBind
        {
            add { _onBind += value; }
            remove { _onBind -= value; }
        }

        private DataTable _dataSource;

        /// 
        /// 数据源
        /// 
        /// The data source.
        public DataTable DataSource
        {
            get { return _dataSource; }
            set { _dataSource = value; }
        }

        /// 
        /// 绑定数据
        /// 
        public override void DataBind()
        {
            this.Nodes.Clear();
            this.ShowCheckBox = this.CheckBoxName != "" && this.CheckBoxName != null;

            if (_dataSource != null)
            {
                TreeNode root_node = new TreeNode();
                root_node.Value = "-1";
                root_node.Text = "根目录";
                Nodes.Add(root_node);

                List root_list = new List();
                for (int i = 0; i < _dataSource.Rows.Count; i++)
                {
                    TreeNode node = new TreeNode();
                    DataRow dr = _dataSource.Rows[i];

                    node.Value = dr[_valueField].ToString();
                    node.Text = dr[_textField].ToString();
                    node.SelectAction = TreeNodeSelectAction.None;
                    //node.Depth =int.Parse(_showLevel);
                    if (_onBind != null)
                    {
                        _onBind(node);
                    }

                    if (dr[_fatherField].ToString() == "-1" || dr[_fatherField].ToString() == "0")
                    {
                        Nodes.Add(node);
                        if (node.Value == _checkedValue)
                        {
                            node.Checked = true;
                        }

                        int has = 0;
                        for (int j = 0; j < root_list.Count; j++)
                        {
                            if (root_list[j] == int.Parse(node.Value))
                            {
                                has = 1;
                            }
                        }
                        if (has == 0)
                        {
                            root_list.Add(int.Parse(node.Value));
                        }
                    }
                    else
                    {
                        TreeNode father_node = GetNode(root_node, dr[_fatherField].ToString());
                        if (father_node != null)
                        {
                            father_node.ChildNodes.Add(node);
                            if (node.Value == _checkedValue)
                            {
                                node.Checked = true;
                            }
                        }
                    }
                }
                //绑定事件,自动勾选父级节点
                if (this.CheckParentType == 0 || this.CheckChildType == 0)
                {
                    string enterjvice = "";
                    if (this.CheckParentType == 0)
                    {
                        enterjvice += "FatherChecked";
                    }
                    if (this.CheckChildType == 0)
                    {
                        enterjvice += "ChildChecked";
                    }
                    if (enterjvice != "" && this.Nodes.Count > 0)
                    {
                        this.Attributes.Add("onclick", "JscAutoCheckedNode(this,'" + enterjvice + "');");
                    }
                }
            }
            base.DataBind();
        }

        /// 
        /// 构建HTML
        /// 
        /// The  object that receives the server control content.
        protected override void Render(HtmlTextWriter writer)
        {
            string[] style_list = new string[] { "admin_tree", "data_tree", "input_tree", "menu_tree", "popmenu_tree" };
            switch (_styleName)
            {
                case "menu_tree":
                    this.ShowCheckBox = false;
                    this.CssClass += " menu";
                    break;
                case "popmenu_tree":
                    this.

Public @ 2023-02-24 22:24:01 整理自网络ChatGPT产生之内容,文本内容不具备参考意义,程序内容有且仅有借鉴意义。

Google爬行缓存代理(crawl caching proxy)

Google爬行缓存代理是Google搜索引擎通过代理服务器对网站进行爬行并缓存网页内容的一种技术。该技术可提高网站的访问速度和稳定性,同时也有利于搜索引擎的优化。 当用户访问一个网站时,Google爬行缓存代理会首先检查其缓存中是否有该网站的内容,如果有,则将缓存中的内容返回给用户;如果没有,则该代理服务器会向该网站服务器发送请求,并将获取到的内容缓存起来,以备将来的访问。 Google爬行

Public @ 2023-06-08 01:50:10

什么是搜索引擎蜘蛛

搜索引擎蜘蛛可以简单的理解为页面信息采集工具,不需要人工去采集,它会自动根据URL链接一个一个爬行过去,然后再抓取页面的信息,然后再存到服务器的列队中,为用户提供目标主题所需要的数据资源,搜索引擎蜘蛛不是所有的页面都会抓取的,主要有三个原因:一是技术上的原因。二是服务器存储方面的原因。三是提供用户搜索数据量太大,会影响效率。所以说,搜索引擎蜘蛛一般只是抓取那些重要的网页,而在抓取的时候评价重要性主

Public @ 2017-10-04 16:22:29

蜘蛛程序(spider)

蜘蛛程序(spider)是一种按照一定规则自动地在互联网上检索和获取信息的计算机程序。蜘蛛程序的工作方式类似于蜘蛛在网上爬行,它通过网络链接搜索引擎等目标网站的页面,并按照预先设定的算法和规则提取所需的信息。 蜘蛛程序主要用于搜索引擎的建立与维护,它们能够自动化地获取大量的网页内容,并将其存储在搜索引擎的数据库中。蜘蛛程序可以按照用户设定的关键词和搜索模式来搜索相关的网页,然后将搜索结果进行分析

Public @ 2023-07-24 14:00:31

如何查看网站被百度抓取的情况?

百度用于抓取网页的程序叫做Baiduspider - 百度蜘蛛,我们查看网站被百度抓取的情况主要是分析,网站日志里百度蜘蛛Baiduspider的活跃性:抓取频率,返回的HTTP状态码。如何查看网站被百度抓取的情况?查看日志的方式:通过FTP,在网站根目录找到一个日志文件,文件名一般包含log,下载解压里面的记事本,这即是网站的日志,记录了网站被访问和操作的情况。因为各个服务器和主机的情况不同,不

Public @ 2022-04-18 16:22:33

更多您感兴趣的搜索

0.505176s