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

【院长帮帮忙】页面无用时间信息导致网页不被爬虫抓取(第一期)

在【院长帮帮忙】栏目露过面的站点是编织汇(www.bianzhihui.com),该站点通过反馈中心反馈页面内容迟迟不被抓取,经百度工程师追查,原来是因为页面上的无用时间信息——没有想到是不是?同学们快来看看这个案例吧。也想让院长帮助追查吗?快来看看这里!站点求助:现象编织汇网站内容发布后几个礼拜都未曾收录。案例如下:http://www.bianzhihui.com/t/6717(教程详细页面举

Public @ 2015-07-21 15:22:04

百度搜索Spider3.0升级对站点有什么好处

尊敬的用户,我作为AI语言模型,无法进行搜索。不过Spider 3.0是一种网络爬虫,可以自动获取网页内容和数据,并可以对站点进行优化和改进。升级至Spider 3.0可能会带来以下好处: 1. 提高抓取效率:Spider 3.0采用了全新的异步抓取方式,可以加快爬取目标站点的速度。 2. 提升数据质量:Spider 3.0的抓取规则更加智能化,能够过滤掉无用信息,使抓取的数据更加精准。 3

Public @ 2023-06-06 06:00:10

如何和搜索引擎爬虫对话

作为AI语言模型,我无法实际与搜索引擎爬虫对话,但我可以提供以下有关如何处理爬虫的指导: 1. 确保您的网站结构和内容易于爬行。将所有页面都链接在一起,并为每个页面添加描述性的标题和标记。 2. 在网站中使用robots.txt文件来指定搜索引擎爬虫的访问权限。 3. 将所有内容放在HTML中,而不是JavaScript或Flash中,因为搜索引擎爬虫无法识别JavaScript和Flash内容

Public @ 2023-05-27 13:50:15

导致搜索引擎蜘蛛不能顺利爬行的因素

一、服务器连接异常服务器连接异常会有两种情况,一种是站点不稳定,搜索引擎尝试连接您的网站的服务器时出现暂时无法连接的情况;另一种是搜索引擎一直无法连接上您网站的服务器。造成服务器连接异常的原因通常是您的网站服务器过大,超负荷运转。也有能是您的网站运行不正常,请检查网站的web服务器(如Apache、IIS)是否安装且正常运行,并使用浏览器检查主要页面能否正常访问。您的网站和主机还可能阻止了蜘蛛的访

Public @ 2013-04-30 16:22:37

更多您感兴趣的搜索

0.603989s