Categories


Tags


抢先式多线程网络蜘蛛

框架 // 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:25:29

我不想我的网站被Baiduspider访问,我该怎么做?

您可以在网站的 robots.txt 文件中添加以下内容,以阻止 Baiduspider 访问您的网站: User-agent: Baiduspider Disallow: / 这会告诉 Baiduspider 不要访问您的整个网站。请注意,这也可能会阻止其他搜索引擎的访问。如果您只想阻止 Baiduspider 的访问,可以使用以下代码: User-agent: Baiduspider D

Public @ 2023-05-31 13:50:13

搜狗搜索蜘蛛爬虫抓取

蜘蛛爬虫是一种自动化程序,用于在互联网上抓取网页和提取其中的信息。搜狗搜索的蜘蛛爬虫被用于收集来源于各种网站的数据,以用于搜索引擎的索引和排名。下面是关于搜狗搜索蜘蛛爬取的一些信息: 1. 网页抓取:搜狗搜索蜘蛛通过HTTP请求技术可以访问网页,并从中提取HTML代码。 2. 链接跟踪:蜘蛛通过跟踪网页中的链接来继续抓取其他相关网页。它会自动发现和跟踪新的链接,以便持续地获取更多的数据。 3

Public @ 2023-07-30 09:50:26

Chrome浏览器模拟百度蜘蛛访问

Chrome浏览器可以通过安装相关的扩展程序来模拟百度蜘蛛访问。 以下是具体步骤: 1. 在Chrome浏览器中安装User-Agent Switcher for Chrome扩展程序。 2. 在浏览器的顶部右侧,点击扩展程序图标,然后选择User-Agent Switcher for Chrome。 3. 点击“Options”按钮,然后选择“Add new user-agent”,输入你要

Public @ 2023-03-31 03:00:23

如何提高spider抓取网站?提高spider抓取策略(1)

SEO网站优化SEOER,每天都要时刻关注百度蜘蛛有没有来抓取网站,抓取了网站哪些内容,没有抓取网站哪些内容,再没有抓取的页面上观察调整网站的问题。想要提高爬虫抓取频率可以从几个方面着手,简单介绍提高spider抓取网站的策略。提高spider抓取策略有哪些?一、抓取友好性:抓取压力调配降低对网站的访问压力带宽造成访问压力大,会直接影响网站的正常用户访问,为了不影响网站的正常用户访问,又能让spi

Public @ 2010-03-31 16:22:35

更多您感兴趣的搜索

0.416564s