官网

http://www.hzhcontrols.com

前提

入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章。

GitHub:https://github.com/kwwwvagaa/NetWinformControl

码云:https://gitee.com/kwwwvagaa/net_winform_custom_control.git

如果觉得写的还行,请点个 star 支持一下吧

欢迎前来交流探讨: 企鹅群568015492 

idkey=6e08741ef16fe53bf0314c1c9e336c4f626047943a8b76bac062361bab6b4f8d">

目录

https://www.cnblogs.com/bfyx/p/11364884.html

准备工作

GDI+需要有一点了解,不知道的可以百度瞅瞅

开始

添加一个用户控件,命名UCSwitch

添加一个枚举用以控制样式

 public enum SwitchType
{
/// <summary>
/// 椭圆
/// </summary>
Ellipse,
/// <summary>
/// 四边形
/// </summary>
Quadrilateral,
/// <summary>
/// 横线
/// </summary>
Line
}

添加属性

   [Description("选中改变事件"), Category("自定义")]
public event EventHandler CheckedChanged;
private Color m_trueColor = Color.FromArgb(, , ); [Description("选中时颜色"), Category("自定义")]
public Color TrueColor
{
get { return m_trueColor; }
set
{
m_trueColor = value;
Refresh();
}
} private Color m_falseColor = Color.FromArgb(, , ); [Description("没有选中时颜色"), Category("自定义")]
public Color FalseColor
{
get { return m_falseColor; }
set
{
m_falseColor = value;
Refresh();
}
} private bool m_checked; [Description("是否选中"), Category("自定义")]
public bool Checked
{
get { return m_checked; }
set
{
m_checked = value;
Refresh();
if (CheckedChanged != null)
{
CheckedChanged(this, null);
}
}
} private string[] m_texts; [Description("文本值,当选中或没有选中时显示,必须是长度为2的数组"), Category("自定义")]
public string[] Texts
{
get { return m_texts; }
set
{
m_texts = value;
Refresh();
}
}
private SwitchType m_switchType = SwitchType.Ellipse; [Description("显示类型"), Category("自定义")]
public SwitchType SwitchType
{
get { return m_switchType; }
set
{
m_switchType = value;
Refresh();
}
} public override Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
Refresh();
}
}

重绘

  protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphics;
g.SetGDIHigh();
if (m_switchType == HZH_Controls.Controls.SwitchType.Ellipse)
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
GraphicsPath path = new GraphicsPath();
path.AddLine(new Point(this.Height / , ), new Point(this.Width - this.Height / , ));
path.AddArc(new Rectangle(this.Width - this.Height - , , this.Height - , this.Height - ), -, );
path.AddLine(new Point(this.Width - this.Height / , this.Height - ), new Point(this.Height / , this.Height - ));
path.AddArc(new Rectangle(, , this.Height - , this.Height - ), , );
g.FillPath(new SolidBrush(fillColor), path); string strText = string.Empty;
if (m_texts != null && m_texts.Length == )
{
if (m_checked)
{
strText = m_texts[];
}
else
{
strText = m_texts[];
}
} if (m_checked)
{
g.FillEllipse(Brushes.White, new Rectangle(this.Width - this.Height - + , + , this.Height - - , this.Height - - ));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point((this.Height - - ) / , intTextY));
}
}
else
{
g.FillEllipse(Brushes.White, new Rectangle( + , + , this.Height - - , this.Height - - ));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - (int)sizeF.Width / , intTextY));
}
}
}
else if (m_switchType == HZH_Controls.Controls.SwitchType.Quadrilateral)
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
GraphicsPath path = new GraphicsPath();
int intRadius = ;
path.AddArc(, , intRadius, intRadius, 180f, 90f);
path.AddArc(this.Width - intRadius - , , intRadius, intRadius, 270f, 90f);
path.AddArc(this.Width - intRadius - , this.Height - intRadius - , intRadius, intRadius, 0f, 90f);
path.AddArc(, this.Height - intRadius - , intRadius, intRadius, 90f, 90f); g.FillPath(new SolidBrush(fillColor), path); string strText = string.Empty;
if (m_texts != null && m_texts.Length == )
{
if (m_checked)
{
strText = m_texts[];
}
else
{
strText = m_texts[];
}
} if (m_checked)
{
GraphicsPath path2 = new GraphicsPath();
path2.AddArc(this.Width - this.Height - + , + , intRadius, intRadius, 180f, 90f);
path2.AddArc(this.Width - - - intRadius, + , intRadius, intRadius, 270f, 90f);
path2.AddArc(this.Width - - - intRadius, this.Height - - intRadius - , intRadius, intRadius, 0f, 90f);
path2.AddArc(this.Width - this.Height - + , this.Height - - intRadius - , intRadius, intRadius, 90f, 90f);
g.FillPath(Brushes.White, path2); if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point((this.Height - - ) / , intTextY));
}
}
else
{
GraphicsPath path2 = new GraphicsPath();
path2.AddArc( + , + , intRadius, intRadius, 180f, 90f);
path2.AddArc(this.Height - - intRadius, + , intRadius, intRadius, 270f, 90f);
path2.AddArc(this.Height - - intRadius, this.Height - - intRadius - , intRadius, intRadius, 0f, 90f);
path2.AddArc( + , this.Height - - intRadius - , intRadius, intRadius, 90f, 90f);
g.FillPath(Brushes.White, path2); //g.FillEllipse(Brushes.White, new Rectangle(1 + 2, 1 + 2, this.Height - 2 - 4, this.Height - 2 - 4));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - (int)sizeF.Width / , intTextY));
}
}
}
else
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
int intLineHeight = (this.Height - - ) / ; GraphicsPath path = new GraphicsPath();
path.AddLine(new Point(this.Height / , (this.Height - intLineHeight) / ), new Point(this.Width - this.Height / , (this.Height - intLineHeight) / ));
path.AddArc(new Rectangle(this.Width - this.Height / - intLineHeight - , (this.Height - intLineHeight) / , intLineHeight, intLineHeight), -, );
path.AddLine(new Point(this.Width - this.Height / , (this.Height - intLineHeight) / + intLineHeight), new Point(this.Width - this.Height / , (this.Height - intLineHeight) / + intLineHeight));
path.AddArc(new Rectangle(this.Height / , (this.Height - intLineHeight) / , intLineHeight, intLineHeight), , );
g.FillPath(new SolidBrush(fillColor), path); if (m_checked)
{
g.FillEllipse(new SolidBrush(fillColor), new Rectangle(this.Width - this.Height - + , + , this.Height - - , this.Height - - ));
g.FillEllipse(Brushes.White, new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
g.FillEllipse(new SolidBrush(fillColor), new Rectangle( + , + , this.Height - - , this.Height - - ));
g.FillEllipse(Brushes.White, new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / + , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
}
}

处理一下点击事件

  void UCSwitch_MouseDown(object sender, MouseEventArgs e)
{
Checked = !Checked;
}

完整代码

 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D; namespace HZH_Controls.Controls
{
[DefaultEvent("CheckedChanged")]
public partial class UCSwitch : UserControl
{
[Description("选中改变事件"), Category("自定义")]
public event EventHandler CheckedChanged;
private Color m_trueColor = Color.FromArgb(, , ); [Description("选中时颜色"), Category("自定义")]
public Color TrueColor
{
get { return m_trueColor; }
set
{
m_trueColor = value;
Refresh();
}
} private Color m_falseColor = Color.FromArgb(, , ); [Description("没有选中时颜色"), Category("自定义")]
public Color FalseColor
{
get { return m_falseColor; }
set
{
m_falseColor = value;
Refresh();
}
} private bool m_checked; [Description("是否选中"), Category("自定义")]
public bool Checked
{
get { return m_checked; }
set
{
m_checked = value;
Refresh();
if (CheckedChanged != null)
{
CheckedChanged(this, null);
}
}
} private string[] m_texts; [Description("文本值,当选中或没有选中时显示,必须是长度为2的数组"), Category("自定义")]
public string[] Texts
{
get { return m_texts; }
set
{
m_texts = value;
Refresh();
}
}
private SwitchType m_switchType = SwitchType.Ellipse; [Description("显示类型"), Category("自定义")]
public SwitchType SwitchType
{
get { return m_switchType; }
set
{
m_switchType = value;
Refresh();
}
} public override Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
Refresh();
}
} public UCSwitch()
{
InitializeComponent();
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.Selectable, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.MouseDown += UCSwitch_MouseDown;
} void UCSwitch_MouseDown(object sender, MouseEventArgs e)
{
Checked = !Checked;
} protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphics;
g.SetGDIHigh();
if (m_switchType == HZH_Controls.Controls.SwitchType.Ellipse)
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
GraphicsPath path = new GraphicsPath();
path.AddLine(new Point(this.Height / , ), new Point(this.Width - this.Height / , ));
path.AddArc(new Rectangle(this.Width - this.Height - , , this.Height - , this.Height - ), -, );
path.AddLine(new Point(this.Width - this.Height / , this.Height - ), new Point(this.Height / , this.Height - ));
path.AddArc(new Rectangle(, , this.Height - , this.Height - ), , );
g.FillPath(new SolidBrush(fillColor), path); string strText = string.Empty;
if (m_texts != null && m_texts.Length == )
{
if (m_checked)
{
strText = m_texts[];
}
else
{
strText = m_texts[];
}
} if (m_checked)
{
g.FillEllipse(Brushes.White, new Rectangle(this.Width - this.Height - + , + , this.Height - - , this.Height - - ));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point((this.Height - - ) / , intTextY));
}
}
else
{
g.FillEllipse(Brushes.White, new Rectangle( + , + , this.Height - - , this.Height - - ));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - (int)sizeF.Width / , intTextY));
}
}
}
else if (m_switchType == HZH_Controls.Controls.SwitchType.Quadrilateral)
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
GraphicsPath path = new GraphicsPath();
int intRadius = ;
path.AddArc(, , intRadius, intRadius, 180f, 90f);
path.AddArc(this.Width - intRadius - , , intRadius, intRadius, 270f, 90f);
path.AddArc(this.Width - intRadius - , this.Height - intRadius - , intRadius, intRadius, 0f, 90f);
path.AddArc(, this.Height - intRadius - , intRadius, intRadius, 90f, 90f); g.FillPath(new SolidBrush(fillColor), path); string strText = string.Empty;
if (m_texts != null && m_texts.Length == )
{
if (m_checked)
{
strText = m_texts[];
}
else
{
strText = m_texts[];
}
} if (m_checked)
{
GraphicsPath path2 = new GraphicsPath();
path2.AddArc(this.Width - this.Height - + , + , intRadius, intRadius, 180f, 90f);
path2.AddArc(this.Width - - - intRadius, + , intRadius, intRadius, 270f, 90f);
path2.AddArc(this.Width - - - intRadius, this.Height - - intRadius - , intRadius, intRadius, 0f, 90f);
path2.AddArc(this.Width - this.Height - + , this.Height - - intRadius - , intRadius, intRadius, 90f, 90f);
g.FillPath(Brushes.White, path2); if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point((this.Height - - ) / , intTextY));
}
}
else
{
GraphicsPath path2 = new GraphicsPath();
path2.AddArc( + , + , intRadius, intRadius, 180f, 90f);
path2.AddArc(this.Height - - intRadius, + , intRadius, intRadius, 270f, 90f);
path2.AddArc(this.Height - - intRadius, this.Height - - intRadius - , intRadius, intRadius, 0f, 90f);
path2.AddArc( + , this.Height - - intRadius - , intRadius, intRadius, 90f, 90f);
g.FillPath(Brushes.White, path2); //g.FillEllipse(Brushes.White, new Rectangle(1 + 2, 1 + 2, this.Height - 2 - 4, this.Height - 2 - 4));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - (int)sizeF.Width / , intTextY));
}
}
}
else
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
int intLineHeight = (this.Height - - ) / ; GraphicsPath path = new GraphicsPath();
path.AddLine(new Point(this.Height / , (this.Height - intLineHeight) / ), new Point(this.Width - this.Height / , (this.Height - intLineHeight) / ));
path.AddArc(new Rectangle(this.Width - this.Height / - intLineHeight - , (this.Height - intLineHeight) / , intLineHeight, intLineHeight), -, );
path.AddLine(new Point(this.Width - this.Height / , (this.Height - intLineHeight) / + intLineHeight), new Point(this.Width - this.Height / , (this.Height - intLineHeight) / + intLineHeight));
path.AddArc(new Rectangle(this.Height / , (this.Height - intLineHeight) / , intLineHeight, intLineHeight), , );
g.FillPath(new SolidBrush(fillColor), path); if (m_checked)
{
g.FillEllipse(new SolidBrush(fillColor), new Rectangle(this.Width - this.Height - + , + , this.Height - - , this.Height - - ));
g.FillEllipse(Brushes.White, new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
g.FillEllipse(new SolidBrush(fillColor), new Rectangle( + , + , this.Height - - , this.Height - - ));
g.FillEllipse(Brushes.White, new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / + , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
}
} } public enum SwitchType
{
/// <summary>
/// 椭圆
/// </summary>
Ellipse,
/// <summary>
/// 四边形
/// </summary>
Quadrilateral,
/// <summary>
/// 横线
/// </summary>
Line
}
}
 namespace HZH_Controls.Controls
{
partial class UCSwitch
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region 组件设计器生成的代码 /// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// UCSwitch
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.Name = "UCSwitch";
this.Size = new System.Drawing.Size(, );
this.ResumeLayout(false); } #endregion
}
}

用处及效果

最后的话

如果你喜欢的话,请到 https://gitee.com/kwwwvagaa/net_winform_custom_control 点个星 星吧

(四十)c#Winform自定义控件-开关-HZHControls的更多相关文章

  1. (四十四)c#Winform自定义控件-水波-HZHControls

    官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...

  2. (二十四)c#Winform自定义控件-单标题窗体

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...

  3. (四)c#Winform自定义控件-选择按钮组

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...

  4. (十四)c#Winform自定义控件-键盘(一)

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...

  5. (五十四)c#Winform自定义控件-仪表盘

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  6. (六十四)c#Winform自定义控件-温度计(工业)

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  7. (七十四)c#Winform自定义控件-金字塔图表

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  8. (八十四)c#Winform自定义控件-导航菜单(类Office菜单)

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  9. (四十六)c#Winform自定义控件-水波进度条-HZHControls

    官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...

随机推荐

  1. 《Java Spring框架》Spring切面(AOP)配置详解

    1.  Spring 基本概念 AOP(Aspect Oriented Programming)称为面向切面编程,在程序开发中主要用来解决一些系统层面上的问题,比如日志,事务,权限等待,Struts2 ...

  2. [译]C# 7系列,Part 2: Async Main 异步Main方法

    原文:https://blogs.msdn.microsoft.com/mazhou/2017/05/30/c-7-series-part-2-async-main/ 你大概知道,C#语言可以构建两种 ...

  3. JS---案例:无缝的轮播图

    案例:无缝的轮播图 w <!DOCTYPE html> <html> <head lang="en"> <meta charset=&qu ...

  4. Ngnix:最通俗解读,Nginx是什么

    Nginx 同 Apache 一样都是一种 Web 服务器.基于 REST 架构风格,以统一资源描述符(Uniform Resources Identifier)URI 或者统一资源定位符(Unifo ...

  5. SAP QM 主检验特性主数据关键字段解释

    SAP QM 主检验特性主数据关键字段解释 检验特征是QM模块中的一项重要主数据,可以说是QM检验业务的构成基础,它通过体现在Task list (检验任务清单)和/或material specifi ...

  6. 使用百度大脑iOCR,快速自定义机票行程单模板识别

    1. 功能介绍百度已经推出了iOCR财会票据识别,针对财会报销场景提出的专项解决方案,可对各类财务票据.报销单.银行回单.对账单进行自动分类及结构化识别,并支持用户为固定版式的新票据/单据自定义结构化 ...

  7. Elasticsearch7.5.0源码编译

    环境及工具 JDK12 Gradle5.6.2 GIT 源码及预处理 到github将代码clone下来,可以根据自己的需求来获取版本,例如 git checkout v7.5.0 提前下载gradl ...

  8. MSSQL - 最佳实践 - 使用SSL加密连接

    MSSQL - 最佳实践 - 使用SSL加密连接 author: 风移 摘要 在SQL Server安全系列专题月报分享中,往期我们已经陆续分享了:如何使用对称密钥实现SQL Server列加密技术. ...

  9. 关于List和String有意思的几个应用

      关于List和String有意思的几个应用 1. List:all_equal 功能:验证列表中的所有元素是否是都一样的. 解析:该技巧是使用[1:] 和 [:-1] 来比较所给定列表中的所有元素 ...

  10. mysql-5.7.27安装

    1,下载5.7.27安装包   百度网盘   (注:5.7.27要安装net faframework4.5.2) 2,创建my.ini及data文件 下载5.7.27后解压,在创建my.ini文件及d ...