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

sogou spider 喜欢收录什么样的页面

内容优良而独特的页面。如果您的页面内容和互联网上已存在的其他页面有高度的相似性,可能不会被 sogou spider 收录。链接层次较浅的页面。过深的链接层次,尤其是动态网页的链接,会被丢弃而不收录。如果是动态网页,请控制参数的数量和URL的长度。搜狗更偏好收录静态网页。重定向次数越多的页面,越有可能被 sogou spider 丢弃。来源:搜狗资源平台

Public @ 2021-05-15 15:38:49

屏蔽百度爬虫的方法

要屏蔽百度爬虫,可以采取以下方法: 1. 使用robots.txt文件:在网站的根目录下创建一个名为robots.txt的文件,并在其中设置百度爬虫的访问限制。例如,可以使用以下指令来禁止百度爬虫访问整个网站: User-agent: Baiduspider Disallow: / 2. 使用meta标签:在网站的HTML代码中添加以下meta标签,告诉百度爬虫不要访问当前页面: 3. 使

Public @ 2023-07-27 07:50:18

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

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

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

网站的搜索引擎蜘蛛抓取越多越好?事实未必

如此 实际上,搜索引擎蜘蛛抓取越多并不一定是越好的。这取决于您的网站是做什么的。如果您的网站有重要的动态内容,那么如果您的搜索引擎蜘蛛抓取过多,将会给您的网站带来压力,导致网站性能和速度下降。如果您的网站是基于静态内容的,例如博客,则搜索引擎蜘蛛抓取更多是没有问题的。

Public @ 2023-02-24 16:00:16

更多您感兴趣的搜索

0.585195s