当前位置: 首页 > 编程日记 > 正文

C#中Winform程序中如何实现多维表头【不通过第三方报表程序】

问题:C#中Winform程序中如何实现多维表头。

在网上搜了很多方法,大多数方法对于我这种新手,看的都不是很懂。最后在新浪博客看到了一篇比较易懂的文章:【DataGridView二维表头与合并单元格】

大体的思路如下:

1.新建一个项目:

2.右键项目名称添加一个组件名为:HeaderUnitView.cs

3.点击【单击此处切换到代码视图】代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Design;
using System.Diagnostics;namespace WindowsFormsApplication1
{public partial class HeaderUnitView : DataGridView{private TreeView[] _columnTreeView;private ArrayList _columnList = new ArrayList();private int _cellHeight = 17;public int CellHeight{get { return _cellHeight; }set { _cellHeight = value; }}private int _columnDeep = 1;private bool HscrollRefresh = false;/// <summary>  /// 水平滚动时是否刷新表头,数据较多时可能会闪烁,不刷新时可能显示错误  /// </summary>  [Description("水平滚动时是否刷新表头,数据较多时可能会闪烁,不刷新时可能显示错误")]public bool RefreshAtHscroll{get { return HscrollRefresh; }set { HscrollRefresh = value; }}/// <summary>/// 构造函数/// </summary>public HeaderUnitView(){InitializeComponent();this.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;//设置列高度显示模式              }public HeaderUnitView(IContainer container){container.Add(this);InitializeComponent();}[Description("设置或获得合并表头树的深度")]public int ColumnDeep{get{if (this.Columns.Count == 0)_columnDeep = 1;this.ColumnHeadersHeight = _cellHeight * _columnDeep;return _columnDeep;}set{if (value < 1)_columnDeep = 1;else_columnDeep = value;this.ColumnHeadersHeight = _cellHeight * _columnDeep;}}[Description("添加合并式单元格绘制的所需要的节点对象")]public TreeView[] ColumnTreeView{get { return _columnTreeView; }set{if (_columnTreeView != null){for (int i = 0; i <= _columnTreeView.Length - 1; i++)_columnTreeView[i].Dispose();}_columnTreeView = value;}}[Description("设置添加的字段树的相关属性")]public TreeView ColumnTreeViewNode{get { return _columnTreeView[0]; }}/// <summary>/// 设置或获取合并列的集合/// </summary>[MergableProperty(false)][Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))][DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Visible)][Localizable(true)][Description("设置或获取合并列的集合"), Browsable(true), Category("单元格合并")]public List<string> MergeColumnNames{get{return _mergecolumnname;}set{_mergecolumnname = value;}}private List<string> _mergecolumnname = new List<string>();public ArrayList NadirColumnList{get{if (_columnTreeView == null)return null;if (_columnTreeView[0] == null)return null;if (_columnTreeView[0].Nodes == null)return null;if (_columnTreeView[0].Nodes.Count == 0)return null;_columnList.Clear();GetNadirColumnNodes(_columnList, _columnTreeView[0].Nodes[0], false);return _columnList;}}///<summary>  ///绘制合并表头  ///</summary>  ///<param name="node">合并表头节点</param>  ///<param name="e">绘图参数集</param>  ///<param name="level">结点深度</param>  ///<remarks></remarks>  public void PaintUnitHeader(TreeNode node,System.Windows.Forms.DataGridViewCellPaintingEventArgs e,int level){//根节点时退出递归调用  if (level == 0)return;RectangleF uhRectangle;int uhWidth;SolidBrush gridBrush = new SolidBrush(this.GridColor);SolidBrush backColorBrush = new SolidBrush(e.CellStyle.BackColor);Pen gridLinePen = new Pen(gridBrush);StringFormat textFormat = new StringFormat();textFormat.Alignment = StringAlignment.Center;uhWidth = GetUnitHeaderWidth(node);if (node.Nodes.Count == 0){uhRectangle = new Rectangle(e.CellBounds.Left,e.CellBounds.Top + node.Level * _cellHeight,uhWidth - 1,_cellHeight * (_columnDeep - node.Level) - 1);}else{uhRectangle = new Rectangle(e.CellBounds.Left,e.CellBounds.Top + node.Level * _cellHeight,uhWidth - 1,_cellHeight - 1);}//画矩形  e.Graphics.FillRectangle(backColorBrush, uhRectangle);//划底线  e.Graphics.DrawLine(gridLinePen, uhRectangle.Left, uhRectangle.Bottom, uhRectangle.Right, uhRectangle.Bottom);//划右端线  e.Graphics.DrawLine(gridLinePen, uhRectangle.Right, uhRectangle.Top, uhRectangle.Right, uhRectangle.Bottom);写字段文本  e.Graphics.DrawString(node.Text, this.Font, new SolidBrush(e.CellStyle.ForeColor), uhRectangle.Left + uhRectangle.Width / 2 -e.Graphics.MeasureString(node.Text, this.Font).Width / 2 - 1, uhRectangle.Top +uhRectangle.Height / 2 - e.Graphics.MeasureString(node.Text, this.Font).Height / 2);//递归调用()  if (node.PrevNode == null)if (node.Parent != null)PaintUnitHeader(node.Parent, e, level - 1);}/// <summary>  /// 获得合并标题字段的宽度  /// </summary>  /// <param name="node">字段节点</param>  /// <returns>字段宽度</returns>  /// <remarks></remarks>  private int GetUnitHeaderWidth(TreeNode node){//获得非最底层字段的宽度  int uhWidth = 0;//获得最底层字段的宽度  if (node.Nodes == null)return this.Columns[GetColumnListNodeIndex(node)].Width;if (node.Nodes.Count == 0)return this.Columns[GetColumnListNodeIndex(node)].Width;for (int i = 0; i <= node.Nodes.Count - 1; i++){uhWidth = uhWidth + GetUnitHeaderWidth(node.Nodes[i]);}return uhWidth;}/// <summary>  /// 获得底层字段索引  /// </summary>  ///' <param name="node">底层字段节点</param>  /// <returns>索引</returns>  /// <remarks></remarks>  private int GetColumnListNodeIndex(TreeNode node){for (int i = 0; i <= _columnList.Count - 1; i++){if (((TreeNode)_columnList[i]).Equals(node))return i;}return -1;}/// <summary>  /// 获得底层字段集合  /// </summary>  /// <param name="alList">底层字段集合</param>  /// <param name="node">字段节点</param>  /// <param name="checked">向上搜索与否</param>  /// <remarks></remarks>  private void GetNadirColumnNodes(ArrayList alList,TreeNode node,Boolean isChecked){if (isChecked == false){if (node.FirstNode == null){alList.Add(node);if (node.NextNode != null){GetNadirColumnNodes(alList, node.NextNode, false);return;}if (node.Parent != null){GetNadirColumnNodes(alList, node.Parent, true);return;}}else{if (node.FirstNode != null){GetNadirColumnNodes(alList, node.FirstNode, false);return;}}}else{if (node.FirstNode == null){return;}else{if (node.NextNode != null){GetNadirColumnNodes(alList, node.NextNode, false);return;}if (node.Parent != null){GetNadirColumnNodes(alList, node.Parent, true);return;}}}}/// <summary>  /// 滚动  /// </summary>  /// <param name="e"></param>  protected override void OnScroll(ScrollEventArgs e){bool scrollDirection = (e.ScrollOrientation == ScrollOrientation.HorizontalScroll);base.OnScroll(e);if (RefreshAtHscroll && scrollDirection)this.Refresh();}/// <summary>  /// 列宽度改变的重写  /// </summary>  /// <param name="e"></param>  protected override void OnColumnWidthChanged(DataGridViewColumnEventArgs e){Graphics g = Graphics.FromHwnd(this.Handle);float uwh = g.MeasureString(e.Column.HeaderText, this.Font).Width;if (uwh >= e.Column.Width) { e.Column.Width = Convert.ToInt16(uwh); }base.OnColumnWidthChanged(e);}/// <summary>  /// 单元格绘制(重写)  /// </summary>  /// <param name="e"></param>  /// <remarks></remarks>  protected override void OnCellPainting(System.Windows.Forms.DataGridViewCellPaintingEventArgs e){try{if (e.RowIndex > -1 && e.ColumnIndex > -1){DrawCell(e);}else{//行标题不重写  if (e.ColumnIndex < 0){base.OnCellPainting(e);return;}if (_columnDeep == 1){base.OnCellPainting(e);return;}//绘制表头  if (e.RowIndex == -1){if (e.ColumnIndex >= NadirColumnList.Count) { e.Handled = true; return; }PaintUnitHeader((TreeNode)NadirColumnList[e.ColumnIndex], e, _columnDeep);e.Handled = true;}}}catch{ }}#region 合并单元格/// <summary>/// 画单元格/// </summary>/// <param name="e"></param>private void DrawCell(DataGridViewCellPaintingEventArgs e){if (e.CellStyle.Alignment == DataGridViewContentAlignment.NotSet){e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;}Brush gridBrush = new SolidBrush(this.GridColor);SolidBrush backBrush = new SolidBrush(e.CellStyle.BackColor);SolidBrush fontBrush = new SolidBrush(e.CellStyle.ForeColor);int cellwidth;//上面相同的行数int UpRows = 0;//下面相同的行数int DownRows = 0;//总行数int count = 0;if (this.MergeColumnNames.Contains(this.Columns[e.ColumnIndex].Name) && e.RowIndex != -1){cellwidth = e.CellBounds.Width;Pen gridLinePen = new Pen(gridBrush);string curValue = e.Value == null ? "" : e.Value.ToString().Trim();string curSelected = this.CurrentRow.Cells[e.ColumnIndex].Value == null ? "" : this.CurrentRow.Cells[e.ColumnIndex].Value.ToString().Trim();if (!string.IsNullOrEmpty(curValue)){#region 获取下面的行数for (int i = e.RowIndex; i < this.Rows.Count; i++){if (this.Rows[i].Cells[e.ColumnIndex].Value.ToString().Equals(curValue)){//this.Rows[i].Cells[e.ColumnIndex].Selected = this.Rows[e.RowIndex].Cells[e.ColumnIndex].Selected;DownRows++;if (e.RowIndex != i){cellwidth = cellwidth < this.Rows[i].Cells[e.ColumnIndex].Size.Width ? cellwidth : this.Rows[i].Cells[e.ColumnIndex].Size.Width;}}else{break;}}#endregion#region 获取上面的行数for (int i = e.RowIndex; i >= 0; i--){if (this.Rows[i].Cells[e.ColumnIndex].Value.ToString().Equals(curValue)){//this.Rows[i].Cells[e.ColumnIndex].Selected = this.Rows[e.RowIndex].Cells[e.ColumnIndex].Selected;UpRows++;if (e.RowIndex != i){cellwidth = cellwidth < this.Rows[i].Cells[e.ColumnIndex].Size.Width ? cellwidth : this.Rows[i].Cells[e.ColumnIndex].Size.Width;}}else{break;}}#endregioncount = DownRows + UpRows - 1;if (count < 2){return;}}if (this.Rows[e.RowIndex].Selected){backBrush.Color = e.CellStyle.SelectionBackColor;fontBrush.Color = e.CellStyle.SelectionForeColor;}//以背景色填充e.Graphics.FillRectangle(backBrush, e.CellBounds);//画字符串PaintingFont(e, cellwidth, UpRows, DownRows, count);if (DownRows == 1){e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, e.CellBounds.Bottom - 1);count = 0;}// 画右边线e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1, e.CellBounds.Top, e.CellBounds.Right - 1, e.CellBounds.Bottom);e.Handled = true;}}/// <summary>/// 画字符串/// </summary>/// <param name="e"></param>/// <param name="cellwidth"></param>/// <param name="UpRows"></param>/// <param name="DownRows"></param>/// <param name="count"></param>private void PaintingFont(System.Windows.Forms.DataGridViewCellPaintingEventArgs e, int cellwidth, int UpRows, int DownRows, int count){SolidBrush fontBrush = new SolidBrush(e.CellStyle.ForeColor);int fontheight = (int)e.Graphics.MeasureString(e.Value.ToString(), e.CellStyle.Font).Height;int fontwidth = (int)e.Graphics.MeasureString(e.Value.ToString(), e.CellStyle.Font).Width;int cellheight = e.CellBounds.Height;if (e.CellStyle.Alignment == DataGridViewContentAlignment.BottomCenter){e.Graphics.DrawString((String)e.Value, e.CellStyle.Font, fontBrush, e.CellBounds.X + (cellwidth - fontwidth) / 2, e.CellBounds.Y + cellheight * DownRows - fontheight);}else if (e.CellStyle.Alignment == DataGridViewContentAlignment.BottomLeft){e.Graphics.DrawString((String)e.Value, e.CellStyle.Font, fontBrush, e.CellBounds.X, e.CellBounds.Y + cellheight * DownRows - fontheight);}else if (e.CellStyle.Alignment == DataGridViewContentAlignment.BottomRight){e.Graphics.DrawString((String)e.Value, e.CellStyle.Font, fontBrush, e.CellBounds.X + cellwidth - fontwidth, e.CellBounds.Y + cellheight * DownRows - fontheight);}else if (e.CellStyle.Alignment == DataGridViewContentAlignment.MiddleCenter){e.Graphics.DrawString((String)e.Value, e.CellStyle.Font, fontBrush, e.CellBounds.X + (cellwidth - fontwidth) / 2, e.CellBounds.Y - cellheight * (UpRows - 1) + (cellheight * count - fontheight) / 2);}else if (e.CellStyle.Alignment == DataGridViewContentAlignment.MiddleLeft){e.Graphics.DrawString((String)e.Value, e.CellStyle.Font, fontBrush, e.CellBounds.X, e.CellBounds.Y - cellheight * (UpRows - 1) + (cellheight * count - fontheight) / 2);}else if (e.CellStyle.Alignment == DataGridViewContentAlignment.MiddleRight){e.Graphics.DrawString((String)e.Value, e.CellStyle.Font, fontBrush, e.CellBounds.X + cellwidth - fontwidth, e.CellBounds.Y - cellheight * (UpRows - 1) + (cellheight * count - fontheight) / 2);}else if (e.CellStyle.Alignment == DataGridViewContentAlignment.TopCenter){e.Graphics.DrawString((String)e.Value, e.CellStyle.Font, fontBrush, e.CellBounds.X + (cellwidth - fontwidth) / 2, e.CellBounds.Y - cellheight * (UpRows - 1));}else if (e.CellStyle.Alignment == DataGridViewContentAlignment.TopLeft){e.Graphics.DrawString((String)e.Value, e.CellStyle.Font, fontBrush, e.CellBounds.X, e.CellBounds.Y - cellheight * (UpRows - 1));}else if (e.CellStyle.Alignment == DataGridViewContentAlignment.TopRight){e.Graphics.DrawString((String)e.Value, e.CellStyle.Font, fontBrush, e.CellBounds.X + cellwidth - fontwidth, e.CellBounds.Y - cellheight * (UpRows - 1));}else{e.Graphics.DrawString((String)e.Value, e.CellStyle.Font, fontBrush, e.CellBounds.X + (cellwidth - fontwidth) / 2, e.CellBounds.Y - cellheight * (UpRows - 1) + (cellheight * count - fontheight) / 2);}}#endregion}
}

4.为窗体Form1添加控件(组件)HeaderUnitView


5.控件的设置:

A、通过属性设置
(1)设置ColumnHeadersHeightSizeM
ode属性为:DisableResizing

(2)编辑列

(3)设置ColumnDeep属性为:2;设置CellHeight和ColumnHeadersHeight属性 (设置一个值)
(4)设置ColumnTreeView属性,添加TreeView

(5)设置ColumnTreeViewNode属性,为TreeView添加节点。

(6)设置RefreshAtHscroll属性为True。
(7)利用DataGridView方法绑定所要显示的数据即可

B、通过代码设置

 //添加列DataGridViewTextBoxColumn tcDM = newDataGridViewTextBoxColumn();tcDM.HeaderText = "班级代码";tcDM.Name = "DM";//tcDM.DataPropertyName = "DM";tcDM.ReadOnly = true;//tcDM.SortMode =DataGridViewColumnSortMode.NotSortable;//tcDM.DefaultCellStyle.Alignment =DataGridViewContentAlignment.MiddleCenter;dgv.Columns.Add(tcDM);DataGridViewTextBoxColumn tcMC = newDataGridViewTextBoxColumn();tcMC.HeaderText = "班级名称";tcMC.Name = "MC";tcMC.ReadOnly = true;dgv.Columns.Add(tcMC);DataGridViewTextBoxColumn tcNan = newDataGridViewTextBoxColumn();tcNan.HeaderText = "男";tcNan.Name = "Nan";tcNan.ReadOnly = true;dgv.Columns.Add(tcNan);DataGridViewTextBoxColumn tcNv = newDataGridViewTextBoxColumn();tcNv.HeaderText = "女";tcNv.Name = "Nv";tcNv.ReadOnly = true;dgv.Columns.Add(tcNv);//增加TreeViewTreeView tv = new TreeView();TreeNode tnDM = new TreeNode("班级代码");tv.Nodes.Add(tnDM);TreeNode tnMC = new TreeNode("班级名称");tv.Nodes.Add(tnMC);TreeNode tnSex = new TreeNode("性别");tv.Nodes.Add(tnSex);TreeNode tnNan = new TreeNode("男");tnSex.Nodes.Add(tnNan);TreeNode tnNv = new TreeNode("女");tnSex.Nodes.Add(tnNv);dgv.ColumnTreeView = new TreeView[] { tv };//设置其他属性dgv.AutoGenerateColumns =false;                                   //不自动增加列dgv.RowHeadersVisible =false;                                     //行头不可见dgv.AllowUserToAddRows = false;dgv.RowTemplate.DefaultCellStyle.Alignment =DataGridViewContentAlignment.MiddleCenter;dgv.ColumnHeadersHeightSizeMode =DataGridViewColumnHeadersHeightSizeMode.DisableResizing;dgv.ColumnDeep = 2;dgv.CellHeight = 25;dgv.ColumnHeadersHeight = 50;dgv.RefreshAtHscroll = true;

三、添加一条数据

    dgv.Rows.Add();   //添加行dgv.Rows[0].Cells["DM"].Value= "2003001";dgv.Rows[0].Cells["MC"].Value= "网络一班"; ;dgv.Rows[0].Cells["Nan"].Value= "26人";dgv.Rows[0].Cells["Nv"].Value= "18人";

四、合并单元格

headerUnitView1.MergeColumnNames.Add("Column11");//Column11需要合并单元格的列

如果有三层表头就把ColumnDeep改成3,,依次...




转载于:https://www.cnblogs.com/ss0xt/p/6667185.html

相关文章:

斗地主发牌编程PHP,JAVA代码之斗地主发牌详解

package com.oracle.demo01;import java.util.ArrayList;import java.util.Collections;import java.util.HashMap;import java.util.Map;public class Doudizhu {public static void main(String[] args) {//1.创建扑克牌MapMap pookernew HashMap();//创建所有key所在的容器A…

2022-2028年中国自动化设备市场研究及前瞻分析报告

【报告类型】产业研究 【报告价格】4500起 【出版时间】即时更新&#xff08;交付时间约3个工作日&#xff09; 【发布机构】智研瞻产业研究院 【报告格式】PDF版 本报告介绍了中国自动化设备行业市场行业相关概述、中国自动化设备行业市场行业运行环境、分析了中国自动化…

转发:某些函数需要将其一个或多个实参连同类型不变地转发给其他函数

16.47 编写你自己版本的翻转函数&#xff0c;通过调用接受左值和右值引用参数的函数来测试它。 #include<iostream> #include<string> #include<utility> using namespace std;template <typename T> int compare(const T &a ,const T &b) {if…

pycharm远程调试或运行代码

第一步&#xff1a;开始 第二步&#xff1a;设置远程服务器 第三步&#xff0c;查看 第四步&#xff0c;选择解释器&#xff0c;和指定文件映射路径&#xff08;相对上一步指定的相对路径&#xff09; 转载于:https://www.cnblogs.com/jeshy/p/11182359.html

LTE随机接入过程

随机接入的基本流程 Msg3和Msg4只有基于竞争的随机接入才存在&#xff0c;之所以叫Msg3/Msg4是因为不同的随机接入情况&#xff0c;Msg3/Msg4的消息不相同(本文稍后介绍)。 下图中的参数<ra-ResponseWindowSize>和<mac-ContentionResolutionTimer>来自SIB2中的rach…

workday与oracle,workingday与workday的区别 – 手机爱问

2005-04-11for的用法&#xff26;&#xff2f;&#xff32;到底应该怎么用&#xff1f;对于for的用法的确很多&#xff0c;可用作介词和连词&#xff0c;介词用法尤为丰富。以下详细列出了用法和句例&#xff0c;供你参考。for 1 preposition1used to say who is intended to g…

OGRE 2.1 Windows 编译

版权所有&#xff0c;转载请注明链接 OGRE 2.1 Windows 编译 环境&#xff1a;  Windows 7 64Bit  Visual Studio 2012  OGRE 2.1  CMake 2.8.12.1 OGRE&#xff1a;  OGRE官方推出了最新的OGRE2.1版本&#xff0c;链接地址&#xff1a;    https://bitbucket.or…

IDEA集成Docker插件实现一键自动打包部署微服务项目

一. 前言 大家在自己玩微服务项目的时候&#xff0c;动辄十几个服务&#xff0c;每次修改逐一部署繁琐不说也会浪费越来越多时间&#xff0c;所以本篇整理通过一次性配置实现一键部署微服务&#xff0c;实现真正所谓的一劳永逸。 二. 配置服务器 1. Docker安装 服务器需要安…

PHP的学习--PHP的引用

引用是什么 在 PHP 中引用意味着用不同的名字访问同一个变量内容。这并不像 C 的指针&#xff0c;替代的是&#xff0c;引用是符号表别名。注意在 PHP 中&#xff0c;变量名和变量内容是不一样的&#xff0c;因此同样的内容可以有不同的名字。最接近的比喻是 Unix 的文件名和文…

谈一谈浏览器解析CSS选择器的过程【前端每日一题-6】

谈一谈浏览器解析CSS选择器的过程&#xff1f; 这是一道发散题&#xff0c;可以根据自己的理解自行解答。 在开始前&#xff0c;我们必须了解一个真相&#xff1a;为什么排版引擎解析 CSS 选择器时一定要从右往左解析&#xff1f; 简单的来说&#xff1a;浏览器从右到左进行查找…

LTE: MIB和SIB,小区选择和重选规则

LTE 中MIB/SIB内容可以参考&#xff1a;https://blog.csdn.net/wowricky/article/details/51348613 MIB/SIB的详细内容参考下面两张图 MIB,SIB1,SIB2 可以关注下小区选择的参数&#xff0c;用特殊颜色表示 36.304 - 5.2.3.2 Cell Selection Criterion S准则&#xff0c;需要…

linux 生成dll文件,Linux和Windows平台 动态库.so和.dll文件的生成

Linux动态库的生成1、 纯cpp文件打包动态库将所有cpp文件和所需要的头文件放在同一文件夹&#xff0c;然后执行下面命令gcc -shared - fpic *.c -o xxx.so&#xff1b;g -stdc17 - fpic *.cpp -o xxx.so&#xff1b;[C17标准&#xff0c;需要高版本gcc&#xff0c;本人采用gcc …

Form表单提交前进行JS验证的3种方式

1. 提交按钮的onclick事件中验证 <script type"text/javascript"> function check(form) { return true; }</script> <form> <input type"submit" name"submit1" value"登陆" οnc…

2022-2028年中国椎间孔镜行业市场研究及前瞻分析报告

【报告类型】产业研究 【报告价格】4500起 【出版时间】即时更新&#xff08;交付时间约3个工作日&#xff09; 【发布机构】智研瞻产业研究院 【报告格式】PDF版 本报告介绍了中国椎间孔镜行业市场行业相关概述、中国椎间孔镜行业市场行业运行环境、分析了中国椎间孔镜行…

mysql 错误:1166 解决办法

原因&#xff1a;检查字段里面是不是有空格&#xff0c;去掉就可以了转载于:https://www.cnblogs.com/zhizhan/p/3950453.html

优先级队列(小顶堆)的dijkstra算法

php实现迪杰斯特拉算法&#xff0c;并由小顶堆优化 1 <?php2 3 class DEdge4 {5 public $nextIndex, $length;6 7 public function __construct($nextIndex, $length)8 {9 $this->nextIndex $nextIndex;10 $this->length $length;11 …

室内设计木地板材质合集包 Arroway – Design Craft Vol.4

室内设计木地板材质合集包 Arroway – Design Craft Vol.4 室内设计木地板材质合集包 Arroway – Design Craft Vol.4 阿洛维——设计工艺第四卷 大小&#xff1a;20G 信息: 云桥网络 平台获取素材&#xff01; 36种单板纹理 纹理包括漫反射、法线、凹凸、反射率、环境遮挡…

linux下有关phy的命令,linux – 如何为Debian安装b43-lpphy-installer?

b43-lpphy-installer是Ubuntu的包的名称,而不是Debian的包.你可以在jessie(Debian 8)中使用命令安装它&#xff1a;sudo apt-get install firmware-b43-installer通过内核版本,您似乎正在使用Debian 8.要了解有关debian软件包的详细信息,您可以按名称或文件搜索软件包&#xff…

Idea SpringBoot 基于 Docker容器环境进行远程调试

远程服务环境要求 对启动的jar服务命令进行修改&#xff0c;改成远程调试模式启动 eg: java -jar -agentlib:jdwptransportdt_socket,servery,suspendn,address18761 app.jar此命令特别之处是 关注监听端口&#xff1a;address18761&#xff0c;这端口号随性定义。 -agentl…

[转载]python optionparser1

原文地址&#xff1a;python optionparser1作者&#xff1a;afu7Python 有两个内建的模块用于处理命令行参数&#xff1a; 一个是 getopt&#xff0c;《Deep in python》一书中也有提到&#xff0c;只能简单处理 命令行参数&#xff1b; 另一个是 optparse&#xff0c;它功能强…

回溯法实现正则匹配判断

*&#xff1a;匹配任意个字符 &#xff1f;&#xff1a;匹配至多1个字符 <?phpclass MNode {public $strIndex;public $patIndex;public $leftMatch null; //精确匹配public $midMatch null; //模式匹配public $rightMatch null; //不能匹配public function __con…

Blender中的Python脚本介绍学习教程

Blender中的Python脚本介绍学习教程 MP4 |视频:h264&#xff0c;1280720 |音频:AAC&#xff0c;48000 Hz 语言&#xff1a;英语中英文字幕&#xff08;根据原英文字幕机译更准确&#xff09;|大小解压后:1.63 GB |时长:2h 39m 你会学到什么 云桥网络 平台获取教程&#xf…

linux的veth导致网络不通,linux的veth对网桥通信实验

本实验脚本如下:#!/bin/bash#网桥名称bridgebr0#网桥接入端ipip1192.168.10.1ip2192.168.10.2#veth名称tap1tap1tap2tap2#创建网络命名空间ip netns add ns1ip netns add ns2#创建并启用网桥br0,且关闭stpip link add $bridge type bridgeip link set $bridge type bridge stp_…

图片和文件上传的两款插件

订定转载于:https://www.cnblogs.com/mc67/p/4818276.html

2022-2028年中国装配式装修行业市场研究及前瞻分析报告

【报告类型】产业研究 【报告价格】4500起 【出版时间】即时更新&#xff08;交付时间约3个工作日&#xff09; 【发布机构】智研瞻产业研究院 【报告格式】PDF版 本报告介绍了中国装配式装修行业市场行业相关概述、中国装配式装修行业市场行业运行环境、分析了中国装配式…

使用 acl 库编写发送邮件的客户端程序

2019独角兽企业重金招聘Python工程师标准>>> 邮件做为最早和最广的互联应网用之一&#xff0c;已经与人们的生活息息相关。我们虽然经常使用 Outlook Express/Outlook/Foxmail 等邮件客户端发送邮件&#xff0c;但并不关心发送过程的细节。如果您是一名程序员&#…

Unreal Engine+Houdini创造程序性游戏场景视频教程

Unreal EngineHoudini创造程序性游戏场景视频教程 大小解压后&#xff1a;27.4G 持续时间14小时30分 包括项目文件 1920X1080 高清视频 程序游戏环境——虚幻引擎和Houdini 信息: 云桥网络 平台获取教程 导言: 欢迎来到虚幻引擎4和Houdini的程序游戏环境课程&#xff0…

清理内存clear

清理内存clear&#xff1a; package com.android.cleanprocesstool;import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import a…

linux mv 环境变量,linux环境变量,cp,mv命令,more,less,cat,tail,head,的使用...

linux环境变量&#xff0c;cp&#xff0c;mv命令&#xff0c;more&#xff0c;less&#xff0c;cat&#xff0c;tail&#xff0c;head&#xff0c;的使用[email protected] ~]# cp /usr/bin/ls /tmp/[[email protected] ~]# PATH$PATH:/tmp/ path的使用/usr/local/sbin…

进入Docker容器命令

进入Docker容器命令 docker执行命令: docker exec -it [容器ID或者容器名称] /bin/bash 如果出现下述问题&#xff1a; OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused "exec: \"/bin/bash\": stat /b…