vb.net 实时监控双门双向门禁控制板源代码

 本示例使用设备介绍:实时网络双门双向门禁控制板可二次编程控制网络继电器远程开关-淘宝网 (taobao.com)

Imports System.Net.Sockets
Imports System.Net
Imports System.Text
Imports System.ThreadingImports System.Net.NetworkInformation
Imports System.Management
Public Class Form1Dim PortNumber As Integer  ''侦听端口号    Dim ListenerThre As Thread ''侦听线程Dim LocalIp As String      ''本地ip64Dim ready As Boolean = False ''线程运行标识Dim machinnos As StringDim RemoteIPoint As IPEndPointDim BeepCode As StringDim VoiceCode As StringPublic ListenerSock As Socket ''侦听socketDelegate Sub EditUi(ByVal data0 As String, ByVal data1 As String)  '线程内更新UI传送两个参数Delegate Sub EditTC(ByVal con As Integer, ByVal data1 As String)Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load'Control.CheckForIllegalCrossThreadCalls = False   '经典解决“线程间操作无效: 从不是创建控件的线程访问它 ,尽量不要用这种方式getIp()ComboBox2.SelectedIndex = 0ComboBox3.SelectedIndex = 1ComboBox4.SelectedIndex = 16ComboBox5.SelectedIndex = 1StartListener() ''开始侦听End SubPublic Sub getIp()     '获取本机所有网卡的IPDim Address() As System.Net.IPAddressDim i As IntegerAddress = Dns.GetHostByName(Dns.GetHostName()).AddressListIf UBound(Address) < 0 ThenMsgBox("未能查找到本台电脑安装的网卡,暂不能启动本软件。", MsgBoxStyle.Critical + vbOKOnly, "注意")EndElseFor i = 0 To UBound(Address)ComboBox1.Items.Add(Address(i).ToString())NextComboBox1.SelectedIndex = 0LocalIp = ComboBox1.Text.Trim()End IfEnd SubPrivate Sub StartListener()Dim LocalPoint As IPEndPointPortNumber = TextBox6.TextWhile Not readyTryLocalPoint = New IPEndPoint(IPAddress.Parse(LocalIp), PortNumber)ListenerSock = New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)ListenerSock.Bind(LocalPoint)ListenerThre = New Thread(AddressOf ThrListener)ListenerThre.Start()ready = True'ListBox1.Items.Add(LocalPoint.ToString() & "已开始侦听......")Catch ex As ExceptionListenerSock.Close()ready = FalseMsgBox("    有其它应用程序占用了 " & LocalPoint.ToString() & " ,请检查并关闭此应用后再打开本程序。", vbCritical + vbOKOnly, "警告")EndEnd TryEnd WhileEnd SubPrivate Sub ThrListener() '侦听线程      While readyTryDim bytes(1024) As ByteDim dataArray() As StringDim RemotePoint As System.Net.EndPoint = New System.Net.IPEndPoint(System.Net.IPAddress.Any, 0)Dim NumGet As IntegerDim Msg As StringDim Sendinf As StringDim SendBuf As Byte()Dim i As IntegerDim DevBufferIpAddrStr As StringDim DevBufferRemoteAddrStr As StringDim DevBufferCardCode As StringDim DevBufferUseTimeStr As StringDim DevRecFramesStr As StringDim DevBufferMachinStr As StringDim DevBufferDatetimeStr As StringDim DevBufferCardidStr As StringDim DevBufferUseMoneryStr As StringDim DevBufferReaderStr As StringDim DevBufferDoorNoStr As StringDim DevBufferDelayStr As StringDim DevBufferPasswPropStr As StringDim DevBufferPassWStr As StringDim DevBufferStaryStr As StringDim DevBufferRecordAddStr As StringDim DevBufferAllNoStr As StringDim DevBufferFunctionStr1 As StringDim DevBufferFunctionStr2 As StringDim DevBufferSerialNumStr As StringDim DevBufferInputKeyStr As StringDim DevBufferCommandStr As StringDim DevBufferQrcodeInfStr As StringDim DevBufferStateStr As StringDim DevBufferRandomCode As StringDim DevBufferSwitchStr As StringDim DevBufferFireStr As StringNumGet = ListenerSock.ReceiveFrom(bytes, RemotePoint)Msg = Encoding.GetEncoding(936).GetString(bytes, 0, NumGet)'Msg = Encoding.UTF8.GetString(bytes, 0, NumGet)     '读取中文wifi名称时,需用utf8解码Me.Invoke(New EditUi(AddressOf EditUiNow), Now() & (" FromIP:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:", Msg) '用Invoke跨线程更新UI      Me.Invoke(New EditTC(AddressOf EditTCNow), 3, Convert.ToString(RemotePoint)) '用Invoke跨线程更新UIdataArray = Split(Convert.ToString(Msg), ",")Select Case dataArray(0)Case "101"             '接收到 1、终端开机时向电脑发送的开机信息,         2、电脑发送002查询设备时间所返回的信息DevRecFramesStr = dataArray(1)            '包序列号DevBufferIpAddrStr = dataArray(2)         '终端IPDevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IPDevBufferMachinStr = dataArray(4)         '机号DevBufferDatetimeStr = dataArray(5)       '日期时间*/If dataArray.Length > 6 Then              '2018年以后的设备有唯一硬件序号*/DevBufferSerialNumStr = dataArray(6)End IfSendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)Dim SystemTimeStr As String = String.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now)If DevBufferDatetimeStr.Substring(0, 16) <> SystemTimeStr.Substring(0, 16) ThenSendinf = "003," & DevRecFramesStr & "," & SystemTimeStrSendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)End IfMe.Invoke(New EditTC(AddressOf EditTCNow), 1, DevBufferDatetimeStr) '用Invoke跨线程更新UI      Case "150"                                    '接收到实时考勤门禁机刷卡数据DevRecFramesStr = dataArray(1)            '包序列号DevBufferIpAddrStr = dataArray(2)         '终端IPDevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IPDevBufferMachinStr = dataArray(4)         '机号DevBufferCardidStr = dataArray(5)         '卡号DevBufferReaderStr = dataArray(6)         '消费金额*/DevBufferDoorNoStr = dataArray(7)         '门或继电器号*/DevBufferDelayStr = dataArray(8)          '门磁未关秒数,0表示已关*/DevBufferPasswPropStr = dataArray(9)      '密码属性(0密码无效,1刷卡后按密码,2补签密码,3开门密码,4防迫胁密码)*/DevBufferPassWStr = dataArray(10)         '密码(最多8位数字)*/DevBufferUseTimeStr = dataArray(11)       '消费时间*/                        If dataArray.Length > 12 ThenDevBufferSerialNumStr = dataArray(12)  '2018年以后的设备有唯一硬件序号End IfSendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)'此处加入业务对数据库的查、增、删、减操作'用050指令返回开门成功,051指令返回开门失败,正式系统开发时要有重发机制Select Case VoiceCodeCase "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"  '发送禁止开门的指令"Sendinf = "051," & DevBufferMachinStr & "," & DevBufferCardidStr & "," & TextBox5.Text.Trim() & "," & Format(NumericUpDown2.Value, "0") & "," & BeepCode & "," & VoiceCodeCase Else  '发送开门指令Sendinf = "050," & DevBufferMachinStr & "," & DevBufferCardidStr & "," & TextBox5.Text.Trim() & "," & Format(NumericUpDown2.Value, "0") & "," & BeepCode & "," & VoiceCode & "," & DevBufferReaderStr & "," & DevBufferDoorNoStr & "," & Format(NumericUpDown1.Value, "0") & "," & Format(NumericUpDown2.Value, "0")End SelectSendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)Case "151"                                    '发送按钮开门申请信息DevRecFramesStr = dataArray(1)            '包序列号DevBufferIpAddrStr = dataArray(2)         '终端IPDevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IPDevBufferMachinStr = dataArray(4)         '机号DevBufferInputKeyStr = dataArray(5)       '&&按钮号DevBufferReaderStr = dataArray(6)         '&&对应的门或继电器号DevBufferDelayStr = dataArray(7)          '&&门磁未关秒数(0门已关)DevBufferUseTimeStr = dataArray(8)        '&&刷卡时间If UBound(dataArray) >= 9 Then DevBufferSerialNumStr = dataArray(9) Else DevBufferSerialNumStr = "" '唯一硬件序号Sendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)Select Case VoiceCodeCase "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"  '发送禁止开门的指令"Sendinf = "051," & DevBufferMachinStr & "," & DevBufferInputKeyStr & "," & TextBox5.Text.Trim() & "," & Format(NumericUpDown2.Value, "0") & "," & BeepCode & "," & VoiceCodeCase Else   '发送开门指令Sendinf = "050," & DevBufferMachinStr & "," & DevBufferInputKeyStr & "," & TextBox5.Text.Trim() & "," & Format(NumericUpDown2.Value, "0") & "," & BeepCode & "," & VoiceCode & "," & DevBufferInputKeyStr & "," & DevBufferReaderStr & "," & Format(NumericUpDown1.Value, "0") & "," & Format(NumericUpDown2.Value, "0")End SelectSendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)Case "152"    '门磁报警信息DevRecFramesStr = dataArray(1)        ' &&包序列号DevBufferIpAddrStr = dataArray(2)     ' &&终端IPDevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IPDevBufferMachinStr = dataArray(4)     '&&机号DevBufferInputKeyStr = dataArray(5)   '&&门磁号DevBufferReaderStr = dataArray(6)     '&&对应的门或继电器号DevBufferDelayStr = dataArray(7)      '&&门磁未关秒数(0门已关)DevBufferUseTimeStr = dataArray(8)    '&&刷卡时间If UBound(dataArray) >= 9 Then DevBufferSerialNumStr = dataArray(9) Else DevBufferSerialNumStr = "" '唯一硬件序号Sendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)Case "153"    '返回查询设备状态的053指令DevRecFramesStr = dataArray(1)        ' &&包序列号DevBufferIpAddrStr = dataArray(2)     ' &&终端IPDevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IPDevBufferMachinStr = dataArray(4)     '&&机号DevBufferInputKeyStr = dataArray(5)   '&&继电器号DevBufferReaderStr = dataArray(6)     '&&继电器状态DevBufferDelayStr = dataArray(7)      '&&门磁未关秒数(0门已关)DevBufferStateStr = dataArray(8)      '&&门磁报警状态If UBound(dataArray) >= 9 Then DevBufferSerialNumStr = dataArray(9) Else DevBufferSerialNumStr = "" '唯一硬件序号Sendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)Msg = "继电器号:" & DevBufferInputKeyStr & ",继电器状态:" & DevBufferReaderStr & ",门磁未关秒数:" & DevBufferDelayStr & ",门磁报警状态:" & DevBufferStateStrMe.Invoke(New EditTC(AddressOf EditTCNow), 9, Msg)Case "154"                                    '接收到实时考勤门禁机卡离开感应区DevRecFramesStr = dataArray(1)            '包序列号DevBufferIpAddrStr = dataArray(2)         '终端IPDevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IPDevBufferMachinStr = dataArray(4)         '机号DevBufferCardidStr = dataArray(5)         '卡号DevBufferSerialNumStr = dataArray(6)Case "155" '&&门禁脱网记录发送----DevRecFramesStr = dataArray(1)      ' &&包序列号DevBufferIpAddrStr = dataArray(2)   ' &&终端IPDevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IPDevBufferMachinStr = dataArray(4)     '&&机号DevBufferCardidStr = dataArray(5)     '&&卡号DevBufferReaderStr = dataArray(6)    '&&读头DevBufferDoorNoStr = dataArray(7)    '&&门或继电器号DevBufferPasswPropStr = dataArray(8) '&&密码属性(0密码无效,1刷卡后按密码,2补签密码,3开门密码,4防迫胁密码)DevBufferUseTimeStr = dataArray(9)   '&&刷卡时间DevBufferStaryStr = dataArray(10)    '&&状态  0扣费 1计次DevBufferRecordAddStr = dataArray(11) '&&记录地址标识DevBufferAllNoStr = dataArray(12)    '&&总计录数If UBound(dataArray) = 13 Then DevBufferSerialNumStr = dataArray(13) Else DevBufferSerialNumStr = "" '唯一硬件序号Sendinf = "001," + DevRecFramesStr        '向设备发此数据表示已收到信息,否则设备会连续发三次SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)If Not IsDateTime(DevBufferUseTimeStr) Then  '记录的刷卡时间非法,表示此记录有问题(测试时的其它数据)DevBufferUseTimeStr = "9999-99-99 99:99:99"End If'这里对脱网记录进行处理If CheckBox3.Checked Then  '选择清除已上传的记录驱使用设备继续上传剩下的记录Sendinf = "055," + DevBufferMachinStr + "," + DevBufferCardidStr + "," + DevBufferUseTimeStr + "," + DevBufferRecordAddStr '&&清除设备内当前这条记录,设备才会传下一条记录SendBuf = Encoding.GetEncoding(936).GetBytes(Sendinf)ListenerSock.SendTo(SendBuf, SendBuf.Length, SocketFlags.None, RemotePoint)Me.Invoke(New EditTC(AddressOf EditTCNow), 2, Now() & (" SendTo:" & Convert.ToString(RemotePoint) + "          ").Substring(0, 30) & "Data:" & Sendinf)End IfCase "158" '响应电脑远程开门的058指令DevRecFramesStr = dataArray(1)      ' &&包序列号DevBufferIpAddrStr = dataArray(2)   ' &&终端IPDevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IPDevBufferMachinStr = dataArray(4)     '&&机号DevBufferStaryStr = dataArray(5)      '&&0开门成功,1开门密码认证失败,2开门密码认证失败超过6次,需等待一段时间后再能再次接收058指令(防暴力破解),3 不允许此时间段开门DevBufferRandomCode = dataArray(6)    '&&动态随机码(8位十六进制)Me.Invoke(New EditTC(AddressOf EditTCNow), 10, DevBufferRandomCode)Msg = ""Select Case DevBufferStaryStrCase "0"Msg = "IP:" & DevBufferIpAddrStr & " 开门成功"Case "1"Msg = "IP:" & DevBufferIpAddrStr & " 开门密码认证失败!"Case "2"Msg = "IP:" & DevBufferIpAddrStr & " 开门密码认证失败超过6次,需等待一段时间后再能再次接收058指令(防暴力破解)"Case "3"Msg = "IP:" & DevBufferIpAddrStr & " 不允许此时间段开门"End SelectMe.Invoke(New EditTC(AddressOf EditTCNow), 9, Msg)Me.Invoke(New EditTC(AddressOf EditTCNow), 10, DevBufferRandomCode)Case "159" '&&心跳信息DevRecFramesStr = dataArray(1)      ' &&包序列号DevBufferIpAddrStr = dataArray(2)   ' &&终端IPDevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IPDevBufferMachinStr = dataArray(4)     '&&机号DevBufferQrcodeInfStr = dataArray(5)  '&&信息类型DevBufferSwitchStr = dataArray(6)     '继电器状态(bit0为第1门bit1为第2门)DevBufferFireStr = dataArray(7)       '消防输入状态DevBufferRandomCode = dataArray(8)    '&&动态随机码(8位十六进制)DevBufferDatetimeStr = dataArray(9)   '日期时间DevBufferSerialNumStr = dataArray(10) '设备硬件号Me.Invoke(New EditTC(AddressOf EditTCNow), 10, DevBufferRandomCode)End SelectCatch ex As ExceptionMe.Invoke(New EditTC(AddressOf EditTCNow), 2, "ERROR:" & vbCrLf & ex.GetHashCode & ex.Message & vbCrLf)End TryEnd WhileEnd Sub

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/147237.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

虾皮插件能做数据分析的-知虾数据分析插件Shopee大数据分析平台

在如今的电商行业中&#xff0c;数据分析已经成为了一项至关重要的任务。通过对大量数据的收集和分析&#xff0c;企业可以更好地了解市场趋势、了解竞争对手、优化产品和店铺运营等。然而&#xff0c;要想做好数据分析&#xff0c;一个好用的工具是必不可少的。 虾皮插件——知…

Redis(列表List)

使用LPUSH从头部添加元素&#xff0c;可以一次添加一个或多个。 使用LRANGE 查看列表中的数据&#xff0c;0表示起始位置&#xff0c;-1表示结束位置。 当然也可以使用RPUSH来从尾部添加元素。 可以使用RPOP从尾部删除元素&#xff0c;会返回删除的元素的值。 同理使用LPOP…

openRPA开源项目源码编译

最近接触到了一个新的领域——RPA&#xff0c;RPA全称Robotic Process Automation&#xff0c;中文名为机器人流程自动化。RPA可以视作一个数字机器人&#xff0c;它可以通过程序来模拟人与软件系统的交互过程&#xff0c;代替人工将大量重复、有规则的计算机操作自动化&#x…

C++之map容器

C之map容器 map构造和赋值 #include<iostream> #include<string> using namespace std; #include<map>void printMap(map<int,int>&m) {for (map<int,int>::iterator it m.begin();it ! m.end();it){//cout <<"key is: "&l…

kubernetes部署jenkins

参考&#xff1a;kubernetes 部署 Jenkins jenkins kubernetes pipeline_mob64ca14116c53的技术博客_51CTO博客 第七篇&#xff1a;kubernetes部署jenkins-CSDN博客 1、当前kubernetes集群已部署nfs服务 showmount -e 创建jenkins目录 2、添加jenkins的pvc kubectl create …

Redis(集合Set和有序集合SortedSet)

SET集合中的元素是不允许重复的&#xff0c;SET中的命令都是以S开头的。 使用SADD 在集合中添加元素&#xff0c;使用SMEMBERS查看元素。 当添加重复元素时&#xff0c;会返回0代表添加失败&#xff0c;查询还是就Redis一个元素。 使用SISMEMBER查询元素是否在集合中&#xff…

大师学SwiftUI第18章Part1 - 图片选择器和相机

如今&#xff0c;个人设备主要用于处理图片、视频和声音&#xff0c;苹果的设备也不例外。SwiftUI可以通过​​Image​​视图显示图片&#xff0c;但需要其它框架的支持来处理图片、在屏幕上展示视频或是播放声音。本章中我们将展示Apple所提供的这类工具。 图片选择器 Swift…

Gdevops北京站 2023年全球敏捷运维峰会-核心PPT资料下载

一、峰会简介 2023 Gdevops全球敏捷运维峰会-北京站成功举办&#xff0c;一众产学研界技术大佬与新锐专家&#xff0c;以智能为主线&#xff0c;就数据库、运维、架构、金融科技等领域进行了前沿技术与实践经验交流&#xff0c;一同畅聊AIGC、云原生、数智化转型下的新机遇。 …

ubuntu22.04下hadoop3.3.6+hbase2.5.6+phoenix5.1.3开发环境搭建

一、涉及软件包资源清单 1、java 这里使用的是openjdk 2、hadoop-3.3.6.tar.gz 3、hbase-2.5.6-hadoop3-bin.tar.gz 4、phoenix-hbase-2.5-5.13-bin.tar.gz 5、apache-zookeeper-3.8.3-bin.tar.gz 6、openssl-3.0.12.tar.gz 二、安装 1、操作系统环境准备 换源 sudo vim /et…

【Java 进阶篇】插上翅膀:JQuery 插件机制详解

在前端开发中&#xff0c;JQuery 作为一个广泛应用的 JavaScript 库&#xff0c;为开发者提供了丰富的工具和方法&#xff0c;简化了 DOM 操作、事件处理等繁琐的任务。而在这个庞大的生态系统中&#xff0c;插件机制是 JQuery 的一项重要特性&#xff0c;使得开发者能够轻松地…

解决Redis分布式锁宕机出现不可靠问题-zookeeper分布式锁

核心思想&#xff1a;当客户端要获取锁&#xff0c;则创建节点&#xff0c;使用完锁&#xff0c;则删除该节点。 客户端获取锁时&#xff0c;在 lock 节点下创建临时顺序节点。然后获取 lock下面的所有子节点&#xff0c;客户端获取到所有的子节点之后&#xff0c;如果发现自己…

【漏洞复现】​金和OA存在任意文件读取漏洞

漏洞描述 金和OA协同办公管理系统C6软件(简称金和OA),本着简单、适用、高效的原则,贴合企事业单位的实际需求,实行通用化、标准化、智能化、人性化的产品设计,充分体现企事业单位规范管理、提高办公效率的核心思想,为用户提供一整套标准的办公自动化解决方案,以帮助企…

freetype将字符串制作成位图并显示过程详解

在流媒体项目中字幕显示是不可或缺的一环&#xff0c;一般会有字幕流在视频播放过程中进行显示&#xff1b;不过还有很多情况是从头到尾只在视频的某个区域显示某些文字&#xff0c;例如某个电视台的log&#xff1b;这种也称为字幕&#xff0c;如果想要将这些字符串显示到视频&…

Page分页records有数据,但是total=0,解决办法

Page分页records有数据&#xff0c;但是total0&#xff0c;解决办法 问题&#xff1a;程序运行起来后&#xff0c;后端接收前端传来的搜索请求信息正常&#xff0c;但无法在前端正确反馈信息&#xff0c;通过在后端排查发现total一直等于零&#xff0c;但数据库中有数据&#x…

jenkins清理缓存命令

def jobName "yi-cloud-operation" //删除的项目名称 def maxNumber 300 // 保留的最小编号&#xff0c;意味着小于该编号的构建都将被删除 Jenkins.instance.getItemByFullName(jobName).builds.findAll { it.number < maxNumber }.each { it.delet…

微服务和Spring Cloud Alibaba介绍

1、微服务介绍 1.1 系统架构演变 随着互联网的发展&#xff0c;网站应用的规模也在不断的扩大&#xff0c;进而导致系统架构也在不断的进行变化。从互联网早起到现在&#xff0c;系统架构大体经历了下面几个过程: 单体应用架构 —> 垂直应用架构 —> 分布 式架构—>…

聊一聊前端面临的安全威胁与解决对策

前端是用户在使用您的网站或Web应用程序时首先体验到的东西。如果您的Web应用程序的前端受到侵害&#xff0c;它可能会影响整个布局&#xff0c;并造成糟糕的用户体验&#xff0c;可能难以恢复。集成前端安全变得越来越重要&#xff0c;本文将指导您通过可以应用于保护您的Web应…

[nlp] 损失缩放(Loss Scaling)loss sacle

在深度学习中,由于浮点数的精度限制,当模型参数非常大时,会出现数值溢出的问题,这可能会导致模型训练不稳定。为了解决这个问题,损失缩放(Loss Scaling)技术被引入,它通过缩放损失值来解决这个问题。 在深度学习中,损失缩放技术通常是通过将梯度进行缩放来实现的。具…

vue --version无法显示,只弹出vs窗口

参考连接&#xff1a; nodejs环境配置&#xff08;解压包&#xff09;安装教程_nodejs解压版安装及环境配置_tubond的博客-CSDN博客 原因&#xff1a;环境没搞好&#xff0c;没有设置全局文件夹&#xff0c;node默认放在C盘了&#xff0c;C盘有权限。因为npm -i vue/cli创建…

文章分类列表进行查询(实体类日期格式设置)

categoryController GetMappingpublic Result<List<Category>> list(){List<Category> cs categoryService.list();return Result.success(cs);} categoryService //列表查询List<Category> list(); categoryServiceImpl Overridepublic List<Cat…