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

360搜索蜘蛛IP段及蜘蛛ip被拦截的问题解决方法

360搜索蜘蛛的IP段有很多,不同的版本可能会有不同的IP段。一般来说,以下几个IP段是比较常见的: - 180.76.0.0/16 - 220.181.0.0/16 - 119.63.192.0/21 - 101.226.0.0/15 如果您想限制360搜索蜘蛛的访问,可以通过防火墙或CMS插件进行IP屏蔽。具体方法如下: 1. 防火墙:在防火墙设置中添加规则,拒绝360搜索蜘蛛的IP段访

Public @ 2023-03-30 06:50:24

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

上一篇文章中,给大家简单介绍了提高spider抓取网站策略的两大方法,另外还有五个策略接着给分享给大家。如果没有浏览上篇文章,可以通过以下链接查看:【如何提高spider抓取网站?提高spider抓取策略(1)】提高spider抓取策略有哪些?三、多种URL重定向的识别为了让spider能够对多种URL重定向的识别,重定向分别有三类:HTTP 30x重定向、Meta refresh重定向和JS重定

Public @ 2013-03-16 16:22:34

百度真假蜘蛛IP如何识别?判断百度蜘蛛的鉴别方法

很多SEO从业人员在刚刚接触这个行业的时候,经常会问——百度蜘蛛是什么?我们可以理解为百度蜘蛛就是用来抓取网站链接的IP,小编经常会听到百度蜘蛛来的太频繁,服务器要被抓爆了,如果你无法识别百度蜘蛛,你怎么知道是百度蜘蛛抓爆的呢?也有出现百度蜘蛛都不来了的情况,还有很多站点想得到百度蜘蛛的IP段,想把IP加入白名单,但无法识别百度IP。那怎么才能识别正确的百度蜘蛛呢?来来来,只需做着两点,就能正确识

Public @ 2010-10-11 16:22:32

更多您感兴趣的搜索

0.413844s