C#实现员工ID卡的识别功能
作者:芝麻粒儿 发布时间:2021-08-11 23:49:25
标签:C#,识别,员工,ID
实践过程
效果
代码
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public delegate int HookProc(int nCode, int wParam, IntPtr lParam);
static int hHook = 0;
public const int WH_KEYBOARD_LL = 13;
//LowLevel键盘截获,如果是WH_KEYBOARD=2,并不能对系统键盘截取,Acrobat Reader会在你截取之前获得键盘。
HookProc KeyBoardHookProcedure;
[DllImport("kernel32")]
public static extern int Beep(int dwFreq, int dwDuration);//让计算机蜂鸣
string DataPath = "";//数据库路径
OleDbConnection con;//OleDbConnection对象,连接数据库
OleDbCommand cmd;//OleDbCommand对象,执行SQL语句
//键盘Hook结构函数
[StructLayout(LayoutKind.Sequential)]
public class KeyBoardHookStruct
{
public int vkCode;
public int scanCode;
public int flags;
public int time;
public int dwExtraInfo;
}
[DllImport("user32.dll")]
public static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
//抽掉钩子
public static extern bool UnhookWindowsHookEx(int idHook);
[DllImport("user32.dll")]
//调用下一个钩子
public static extern int CallNextHookEx(int idHook, int nCode, int wParam, IntPtr lParam);
[DllImport("kernel32.dll")]
public static extern IntPtr GetModuleHandle(string name);
public string getNum(string code)
{
string flag = "";
switch (code)
{
case "048":
flag="0"; break;
case "049":
flag = "1"; break;
case "050":
flag = "2"; break;
case "051":
flag = "3"; break;
case "052":
flag = "4"; break;
case "053":
flag = "5"; break;
case "054":
flag = "6"; break;
case "055":
flag = "7"; break;
case "056":
flag = "8"; break;
case "057":
flag = "9"; break;
}
return flag;
}
public void Hook_Start()
{
// 安装键盘钩子
if (hHook == 0)
{
KeyBoardHookProcedure = new HookProc(KeyBoardHookProc);
hHook = SetWindowsHookEx(WH_KEYBOARD_LL,
KeyBoardHookProcedure,
GetModuleHandle(Process.GetCurrentProcess().MainModule.ModuleName), 0);
//如果设置钩子失败.
if (hHook == 0)
{
Hook_Clear();
}
}
}
//取消钩子事件
public void Hook_Clear()
{
bool retKeyboard = true;
if (hHook != 0)
{
retKeyboard = UnhookWindowsHookEx(hHook);
hHook = 0;
}
//如果去掉钩子失败.
if (!retKeyboard) throw new Exception("UnhookWindowsHookEx failed.");
}
//这里可以添加自己想要的信息处理
string NumCode="";
public int KeyBoardHookProc(int nCode, int wParam, IntPtr lParam)
{
if (nCode >= 0)
{
if (wParam == 0x0104 || wParam == 0x0100)
{
KeyBoardHookStruct kbh = (KeyBoardHookStruct)Marshal.PtrToStructure(lParam, typeof(KeyBoardHookStruct));
int flag = kbh.vkCode;
switch (flag)
{
case 96:
NumCode += "0"; break;
case 97:
NumCode += "1"; break;
case 98:
NumCode += "2"; break;
case 99:
NumCode += "3"; break;
case 100:
NumCode += "4"; break;
case 101:
NumCode += "5"; break;
case 102:
NumCode += "6"; break;
case 103:
NumCode += "7"; break;
case 104:
NumCode += "8"; break;
case 105:
NumCode += "9"; break;
}
if (flag == 13)
{
if (NumCode.Length != 0)
{
string c = "";
string id = "";
for (int i = 0; i <= NumCode.Length - 3; i += 3)
{
string b = NumCode.Substring(i, 3);
c += getNum(b);
}
id = c;
if (id.Length == 8)//如果卡号为8位
{
//实例化OleDbConnection对象
con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + DataPath);
con.Open();//打开数据库连接
//实例化OleDbCommand对象,根据ID卡号检索数据表
cmd = new OleDbCommand("select * from tb_UserInfo where CardID='" + id + "'", con);
OleDbDataReader sdr = cmd.ExecuteReader();//实例化OleDbDataReader对象
sdr.Read();//读取记录
txtShowCardID.Text = id;//获取ID卡号
txtShowName.Text = sdr["UName"].ToString();//获取员工姓名
cbbShowSex.Text = sdr["USex"].ToString();//获取员工性别
cbbShowDep.Text = sdr["UDep"].ToString();//获取员工部门
con.Close();//关闭数据库连接
Beep(3000, 100);//计算机蜂鸣
}
NumCode = "";
}
}
}
}
return CallNextHookEx(hHook, nCode, wParam, lParam);
}
private void Form1_Load(object sender, EventArgs e)
{
cbbdep.SelectedIndex = 0;//设置部门下拉框的第一项被选中
cbbsex.SelectedIndex = 0;//设置性别下拉框的第一项被选中
//获取数据库路径
DataPath = Application.StartupPath.ToString();
DataPath = DataPath.Substring(0, DataPath.LastIndexOf("\\"));
DataPath = DataPath.Substring(0, DataPath.LastIndexOf("\\"));
DataPath += @"\db.mdb";
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if (radioButton1.Checked)
{
groupBox1.Enabled = true;
Hook_Clear();
}
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
if (radioButton2.Checked)
{
groupBox1.Enabled = false;
Hook_Start();
}
}
private void button2_Click(object sender, EventArgs e)
{
txtIdcard.Text = "";
txtName.Text = "";
}
private void button1_Click(object sender, EventArgs e)
{
if (txtIdcard.Text == "" || txtName.Text == "")//如果没有输入ID卡号和员工姓名
{
//弹出警告信息
if (MessageBox.Show("请将数据填写完整!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
{
if (txtIdcard.Text == "")//如果没有输入ID卡号
txtIdcard.Focus();//则光标处在输入ID卡号的文本框
if (txtName.Text == "")//如果没有输入员工姓名
txtName.Focus();//则光标处在输入员工姓名的文本框
if (txtIdcard.Text == "" && txtName.Text == "")//如果都没输入数据
txtIdcard.Focus();//则光标处在输入ID卡号的文本框
}
}
else//如果输入了数据
{
if (txtIdcard.Text.Trim().Length != 8)//如果输入的ID卡号不是8位
{
//弹出警告信息
if (MessageBox.Show("ID卡号必须为8位!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
{
txtIdcard.Text = "";//清空输入ID卡号的文本框
txtIdcard.Focus();//让光标处在输入ID卡号的文本框上
}
}
else//如果输入的ID卡号为8位
{
//实例化OleDbConnection对象
con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + DataPath);
con.Open();//打开连接
//实例化OleDbCommand对象
cmd = new OleDbCommand("select count(*) from tb_UserInfo where CardID='"+txtIdcard.Text.Trim()+"'", con);
int flag =Convert.ToInt32(cmd.ExecuteScalar());//判断是否已经添加过此ID卡号
if (flag > 0)//如果大于0则说明已经添加过
{
//弹出警告信息
if (MessageBox.Show("ID卡号已经添加过了!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
{
button2_Click(sender, e);//清空输入ID卡号和员工姓名的文本框
}
}
else//如果小于0说明没有添加过
{
//实例化OleDbCommand对象
cmd = new OleDbCommand("insert into tb_UserInfo(CardID,UName,USex,UDep) values ('" + txtIdcard.Text.Trim() + "','" + txtName.Text.Trim() + "','" + cbbsex.Text.Trim() + "','" + cbbdep.Text.Trim() + "')", con);
int k = cmd.ExecuteNonQuery();//执行insert语句,将输入的信息添加到数据库中
if (k > 0)//如果大于0则操作成功
{
//弹出提示信息
if (MessageBox.Show("添加成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
{
button2_Click(sender, e);//清空输入ID卡号和员工姓名的文本框
}
}
}
con.Close();//关闭数据库连接
}
}
}
private void txtIdcard_KeyPress(object sender, KeyPressEventArgs e)
{
if (!(e.KeyChar <= '9' && e.KeyChar >= '0') && e.KeyChar != '\r' && e.KeyChar != '\b')
{
e.Handled = true;
}
}
}
partial class Form1
{
/// <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 Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtIdcard = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.cbbdep = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.cbbsex = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.cbbShowDep = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
this.cbbShowSex = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label();
this.txtShowName = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.txtShowCardID = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtIdcard);
this.groupBox1.Controls.Add(this.button2);
this.groupBox1.Controls.Add(this.button1);
this.groupBox1.Controls.Add(this.cbbdep);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.cbbsex);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.txtName);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(10, 31);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(435, 120);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "输入员工信息";
//
// txtIdcard
//
this.txtIdcard.Location = new System.Drawing.Point(69, 21);
this.txtIdcard.Name = "txtIdcard";
this.txtIdcard.Size = new System.Drawing.Size(137, 21);
this.txtIdcard.TabIndex = 4;
this.txtIdcard.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtIdcard_KeyPress);
//
// button2
//
this.button2.Location = new System.Drawing.Point(214, 91);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 9;
this.button2.Text = "重置";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(131, 91);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 8;
this.button1.Text = "添加";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// cbbdep
//
this.cbbdep.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbbdep.FormattingEnabled = true;
this.cbbdep.Items.AddRange(new object[] {
"C#部门",
"ASP.NET部门",
"基础部",
"VB部门",
"VC部门",
"JAVA部门"});
this.cbbdep.Location = new System.Drawing.Point(279, 57);
this.cbbdep.Name = "cbbdep";
this.cbbdep.Size = new System.Drawing.Size(137, 20);
this.cbbdep.TabIndex = 7;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(212, 60);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(65, 12);
this.label4.TabIndex = 6;
this.label4.Text = "所属部门:";
//
// cbbsex
//
this.cbbsex.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbbsex.FormattingEnabled = true;
this.cbbsex.Items.AddRange(new object[] {
"男职工",
"女职工"});
this.cbbsex.Location = new System.Drawing.Point(69, 57);
this.cbbsex.Name = "cbbsex";
this.cbbsex.Size = new System.Drawing.Size(137, 20);
this.cbbsex.TabIndex = 5;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 61);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 12);
this.label3.TabIndex = 4;
this.label3.Text = "员工性别:";
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(279, 21);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(137, 21);
this.txtName.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(212, 26);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 12);
this.label2.TabIndex = 2;
this.label2.Text = "员工姓名:";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 26);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 0;
this.label1.Text = "ID卡编号:";
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(10, 8);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(95, 16);
this.radioButton1.TabIndex = 1;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "添加员工信息";
this.radioButton1.UseVisualStyleBackColor = true;
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(10, 157);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(95, 16);
this.radioButton2.TabIndex = 2;
this.radioButton2.Text = "获取员工信息";
this.radioButton2.UseVisualStyleBackColor = true;
this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.cbbShowDep);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.cbbShowSex);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.txtShowName);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.txtShowCardID);
this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Enabled = false;
this.groupBox2.Location = new System.Drawing.Point(10, 179);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(435, 93);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "员工信息";
//
// cbbShowDep
//
this.cbbShowDep.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbbShowDep.FormattingEnabled = true;
this.cbbShowDep.Items.AddRange(new object[] {
"C#部门",
"ASP.NET部门",
"基础部",
"VB部门",
"VC部门",
"JAVA部门"});
this.cbbShowDep.Location = new System.Drawing.Point(279, 57);
this.cbbShowDep.Name = "cbbShowDep";
this.cbbShowDep.Size = new System.Drawing.Size(137, 20);
this.cbbShowDep.TabIndex = 7;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(212, 60);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(65, 12);
this.label5.TabIndex = 6;
this.label5.Text = "所属部门:";
//
// cbbShowSex
//
this.cbbShowSex.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbbShowSex.FormattingEnabled = true;
this.cbbShowSex.Items.AddRange(new object[] {
"男职工",
"女职工"});
this.cbbShowSex.Location = new System.Drawing.Point(69, 57);
this.cbbShowSex.Name = "cbbShowSex";
this.cbbShowSex.Size = new System.Drawing.Size(137, 20);
this.cbbShowSex.TabIndex = 5;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 61);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(65, 12);
this.label6.TabIndex = 4;
this.label6.Text = "员工性别:";
//
// txtShowName
//
this.txtShowName.Location = new System.Drawing.Point(279, 21);
this.txtShowName.Name = "txtShowName";
this.txtShowName.Size = new System.Drawing.Size(137, 21);
this.txtShowName.TabIndex = 3;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(212, 26);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(65, 12);
this.label7.TabIndex = 2;
this.label7.Text = "员工姓名:";
//
// txtShowCardID
//
this.txtShowCardID.Location = new System.Drawing.Point(69, 22);
this.txtShowCardID.Name = "txtShowCardID";
this.txtShowCardID.Size = new System.Drawing.Size(137, 21);
this.txtShowCardID.TabIndex = 1;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(6, 26);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(65, 12);
this.label8.TabIndex = 0;
this.label8.Text = "ID卡编号:";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(457, 276);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.radioButton2);
this.Controls.Add(this.radioButton1);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "Form1";
this.Text = "使用ID卡识别员工编号";
this.Load += new System.EventHandler(this.Form1_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ComboBox cbbdep;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox cbbsex;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.ComboBox cbbShowDep;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox cbbShowSex;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtShowName;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtShowCardID;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox txtIdcard;
}
来源:https://blog.csdn.net/qq_27489007/article/details/128474359
0
投稿
猜你喜欢
- 说明本文主要配置Jackson对Long、Date、LocalDate、LocalDateTime的序列化和反序列化。由于js中整数可精确表
- 这篇文章主要介绍了java读取xml配置参数代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友
- java中如何表示圆周率设计一个Shape接口和它的两个实现类Square和Circle。 要求如下(1) Shape接口中有一个抽象方法a
- Android CardView详解Android5.0中向我们介绍了一个全新的控件–CardView,从本质上看,可以将Car
- 本文实例为大家分享了java实现砸金蛋抽奖的具体代码,供大家参考,具体内容如下代码如下需求:用户每一次砸金蛋,抽中一等奖的概率为2% 二等奖
- 引看懂这张图,方法调用方法,栈开新栈,递归尾结束要回到main栈,必须一级一级返回,每一次返回都是调用整个方法,调用完成栈被释放,直至回到栈
- 一.服务器端获取Session对象依赖于客户端携带的Cookie中的JSESSIONID数据。如果用户把浏览器的隐私级别调到最高,这时浏览器
- 什么是静态单例模式?静态单例模式(Static Singleton Pattern)是我在实践中总结的模式,主要解决的问题是在预先知道某依赖
- android开发中通过View的getDrawingCache方法可以达到截屏的目的,只是缺少状态栏!原始界面截屏得到的图片代码实现1.
- 1. 概述官方JavaDocsApi: javax.swing.JPanelJPanel,面板。JPanel 是在开发中使用频率非常高的一般
- 前言AOP(Aspect Oriented Programming),即面向切面编程,是Spring框架的大杀器之一。首先,我声明下,我不是
- 定义在类里面的类就叫做内部类。内部类的特点:在内部类中可以直接访问外部类的成员,包括私有的成员在外部类中不能直接访问内部类的成员,必须通过创
- 若要在 C++ 中实现异常处理,你可以使用 try、throw 和 catch 表达式。首先,使用 try 块将可能引发异常的一个或多个语句
- 一、简介使用了static 修饰符的方法为静态方法,反之则是非静态方法。 静态方法是一种特殊的成员方法,它不属于类的某一个具体的实
- 1、首先创建一个测试实体类Person,并携带如上注解,其注解的作用描述在messagepackage com.clickpaas.pojo
- 公司项目中经常设计到串口通信,TCP通信,而且大多都是实时的大数据的传输,然后大家都知道协议通讯肯定涉及到什么,封包、拆包、粘包、校验……什
- 最近项目需要加入第三方分享和登录功能,之前其他项目的第三方分享和登录一直都使用ShareSDK实现的。为了统一使用友盟的全家桶,所以三方分享
- 一、什么是并查集对于一种数据结构,肯定是有自己的应用场景和特性,那么并查集是处理什么问题的呢?并查集是一种树型的数据结构,用于处理一些不相交
- Java8对集合提供了一种流式计算的方式,这种风格将要处理的元素集合看 作一种流, 流在管道中传输, 并且可以在管道的节点上进行处理, 比如
- 目录1、Stream API2、ParallelStreams执行原理3、ParallelStreams注意事项前言:并行编程势不可挡,Ja