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

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

Imports System.Net.Sockets
Imports System.Net
Imports System.Text
Imports System.Threading

Imports System.Net.NetworkInformation
Imports System.Management
Public Class Form1
    Dim PortNumber As Integer  ''侦听端口号    
    Dim ListenerThre As Thread ''侦听线程
    Dim LocalIp As String      ''本地ip64
    Dim ready As Boolean = False ''线程运行标识
    Dim machinnos As String
    Dim RemoteIPoint As IPEndPoint
    Dim BeepCode As String
    Dim VoiceCode As String

    Public ListenerSock As Socket ''侦听socket

    Delegate 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 = 0
        ComboBox3.SelectedIndex = 1
        ComboBox4.SelectedIndex = 16
        ComboBox5.SelectedIndex = 1
        StartListener() ''开始侦听
    End Sub

    Public Sub getIp()     '获取本机所有网卡的IP
        Dim Address() As System.Net.IPAddress
        Dim i As Integer
        Address = Dns.GetHostByName(Dns.GetHostName()).AddressList
        If UBound(Address) < 0 Then
            MsgBox("未能查找到本台电脑安装的网卡,暂不能启动本软件。", MsgBoxStyle.Critical + vbOKOnly, "注意")
            End
        Else
            For i = 0 To UBound(Address)
                ComboBox1.Items.Add(Address(i).ToString())
            Next
            ComboBox1.SelectedIndex = 0
            LocalIp = ComboBox1.Text.Trim()
        End If
    End Sub

    Private Sub StartListener()
        Dim LocalPoint As IPEndPoint
        PortNumber = TextBox6.Text
        While Not ready
            Try
                LocalPoint = 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 Exception
                ListenerSock.Close()
                ready = False
                MsgBox("    有其它应用程序占用了 " & LocalPoint.ToString() & " ,请检查并关闭此应用后再打开本程序。", vbCritical + vbOKOnly, "警告")
                End
            End Try
        End While
    End Sub

    Private Sub ThrListener() '侦听线程      
        While ready
            Try
                Dim bytes(1024) As Byte
                Dim dataArray() As String
                Dim RemotePoint As System.Net.EndPoint = New System.Net.IPEndPoint(System.Net.IPAddress.Any, 0)
                Dim NumGet As Integer
                Dim Msg As String
                Dim Sendinf As String
                Dim SendBuf As Byte()
                Dim i As Integer

                Dim DevBufferIpAddrStr As String
                Dim DevBufferRemoteAddrStr As String
                Dim DevBufferCardCode As String
                Dim DevBufferUseTimeStr As String
                Dim DevRecFramesStr As String
                Dim DevBufferMachinStr As String
                Dim DevBufferDatetimeStr As String
                Dim DevBufferCardidStr As String
                Dim DevBufferUseMoneryStr As String
                Dim DevBufferReaderStr As String
                Dim DevBufferDoorNoStr As String
                Dim DevBufferDelayStr As String
                Dim DevBufferPasswPropStr As String
                Dim DevBufferPassWStr As String
                Dim DevBufferStaryStr As String
                Dim DevBufferRecordAddStr As String
                Dim DevBufferAllNoStr As String
                Dim DevBufferFunctionStr1 As String
                Dim DevBufferFunctionStr2 As String
                Dim DevBufferSerialNumStr As String
                Dim DevBufferInputKeyStr As String
                Dim DevBufferCommandStr As String
                Dim DevBufferQrcodeInfStr As String
                Dim DevBufferStateStr As String
                Dim DevBufferRandomCode As String
                Dim DevBufferSwitchStr As String
                Dim DevBufferFireStr As String

                NumGet = 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跨线程更新UI

                dataArray = Split(Convert.ToString(Msg), ",")
                Select Case dataArray(0)
                    Case "101"             '接收到 1、终端开机时向电脑发送的开机信息,         2、电脑发送002查询设备时间所返回的信息
                        DevRecFramesStr = dataArray(1)            '包序列号
                        DevBufferIpAddrStr = dataArray(2)         '终端IP
                        DevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)         '机号
                        DevBufferDatetimeStr = dataArray(5)       '日期时间*/
                        If dataArray.Length > 6 Then              '2018年以后的设备有唯一硬件序号*/
                            DevBufferSerialNumStr = dataArray(6)
                        End If

                        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)


                        Dim SystemTimeStr As String = String.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now)
                        If DevBufferDatetimeStr.Substring(0, 16) <> SystemTimeStr.Substring(0, 16) Then
                            Sendinf = "003," & DevRecFramesStr & "," & SystemTimeStr
                            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 If

                        Me.Invoke(New EditTC(AddressOf EditTCNow), 1, DevBufferDatetimeStr) '用Invoke跨线程更新UI      

                    Case "150"                                    '接收到实时考勤门禁机刷卡数据
                        DevRecFramesStr = dataArray(1)            '包序列号
                        DevBufferIpAddrStr = dataArray(2)         '终端IP
                        DevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IP
                        DevBufferMachinStr = 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 Then
                            DevBufferSerialNumStr = dataArray(12)  '2018年以后的设备有唯一硬件序号
                        End If

                        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)

                        '此处加入业务对数据库的查、增、删、减操作
                        '用050指令返回开门成功,051指令返回开门失败,正式系统开发时要有重发机制

                        Select Case VoiceCode
                            Case "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 & "," & VoiceCode
                            Case 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 Select
                        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 "151"                                    '发送按钮开门申请信息
                        DevRecFramesStr = dataArray(1)            '包序列号
                        DevBufferIpAddrStr = dataArray(2)         '终端IP
                        DevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IP
                        DevBufferMachinStr = 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 VoiceCode
                            Case "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 & "," & VoiceCode
                            Case 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 Select
                        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 "152"    '门磁报警信息
                        DevRecFramesStr = dataArray(1)        ' &&包序列号
                        DevBufferIpAddrStr = dataArray(2)     ' &&终端IP
                        DevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IP
                        DevBufferMachinStr = 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)     ' &&终端IP
                        DevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IP
                        DevBufferMachinStr = 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 & ",门磁报警状态:" & DevBufferStateStr
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 9, Msg)

                    Case "154"                                    '接收到实时考勤门禁机卡离开感应区
                        DevRecFramesStr = dataArray(1)            '包序列号
                        DevBufferIpAddrStr = dataArray(2)         '终端IP
                        DevBufferRemoteAddrStr = dataArray(3)     '远程电脑指机IP
                        DevBufferMachinStr = dataArray(4)         '机号
                        DevBufferCardidStr = dataArray(5)         '卡号
                        DevBufferSerialNumStr = dataArray(6)

                    Case "155" '&&门禁脱网记录发送----
                        DevRecFramesStr = dataArray(1)      ' &&包序列号
                        DevBufferIpAddrStr = dataArray(2)   ' &&终端IP
                        DevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IP
                        DevBufferMachinStr = 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 If

                    Case "158" '响应电脑远程开门的058指令
                        DevRecFramesStr = dataArray(1)      ' &&包序列号
                        DevBufferIpAddrStr = dataArray(2)   ' &&终端IP
                        DevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IP
                        DevBufferMachinStr = 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 DevBufferStaryStr
                            Case "0"
                                Msg = "IP:" & DevBufferIpAddrStr & " 开门成功"
                            Case "1"
                                Msg = "IP:" & DevBufferIpAddrStr & " 开门密码认证失败!"
                            Case "2"
                                Msg = "IP:" & DevBufferIpAddrStr & " 开门密码认证失败超过6次,需等待一段时间后再能再次接收058指令(防暴力破解)"
                            Case "3"
                                Msg = "IP:" & DevBufferIpAddrStr & " 不允许此时间段开门"
                        End Select
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 9, Msg)
                        Me.Invoke(New EditTC(AddressOf EditTCNow), 10, DevBufferRandomCode)

                    Case "159" '&&心跳信息
                        DevRecFramesStr = dataArray(1)      ' &&包序列号
                        DevBufferIpAddrStr = dataArray(2)   ' &&终端IP
                        DevBufferRemoteAddrStr = dataArray(3) '&&远程电脑指机IP
                        DevBufferMachinStr = 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 Select


            Catch ex As Exception
                Me.Invoke(New EditTC(AddressOf EditTCNow), 2, "ERROR:" & vbCrLf & ex.GetHashCode & ex.Message & vbCrLf)
            End Try
        End While
    End Sub

 

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Python函数进阶

函数进阶 一.函数多返回值二.函数多种传参方式三.匿名函数 一.函数多返回值 思考&#xff1a;如果一个函数有两个return&#xff0c;程序如下 只执行了一个return&#xff0c;原因是return可以退出当前函数&#xff0c;导致return下方代码不会执行 多个返回值 按照返回值的顺…

BananaPi BPI-M6(Raspberry Pi 5) Android 平板电脑镜像测试温度

我已经在本文中介绍了 全新的Banana Pi BPI-M6&#xff0c;并讨论了其与Raspberry Pi 5的硬件特性比较。 然后我将 Android 平板电脑固件上传到 eMMC&#xff0c;从而使 Banana Pi 实际可用。一开始有点坎坷&#xff0c;但文章中有更多内容。 在另一台电脑上&#xff0c;一切都…

Vatee万腾未来科技之航:Vatee创新引领的新纪元

在当今数字化时代&#xff0c;Vatee万腾科技正在开创一段引领未来的全新征程。以其卓越的创新能力和领导地位&#xff0c;Vatee万腾成为数字化领域的引领者。其未来科技之航展现了一种独特的数字化愿景&#xff0c;引领着科技创新进入新的纪元。 Vatee万腾在数字科技领域展现出…

如何使用功率信号源保证高精度测量

使用功率信号源是实现高精度测量的关键因素之一。在许多应用中&#xff0c;精确的功率信号源可以提供稳定、可靠的信号&#xff0c;帮助实现准确的测量结果。以下是使用功率信号源保证高精度测量的几个关键方面&#xff1a; 信号稳定性&#xff1a;在进行精确测量时&#xff0c…

热点检测/降级框架Akali的部分原理解析

发现个“轻量级本地化热点检测/降级框架 这个框架名为Akali,项目地址&#xff1a;https://gitee.com/bryan31/Akali主要有两个作用 1&#xff1a;热点检测及处理 2&#xff1a;降级检测及处理 从官网文档来看使用是比较简单的&#xff0c;一个注解就能搞定 怀着好奇的心情c…

光模块厂家如何提高千兆光模块和万兆光模块的可靠性

随着互联网的发展&#xff0c;光纤通信作为高速、稳定的通信方式越来越受到人们的关注。而千兆光模块和万兆光模块作为通信中必不可少的组成部分&#xff0c;其可靠性一直是厂家和用户所关注的重要问题。光模块的不可靠性会导致通信系统的故障和影响用户的体验&#xff0c;因此…

networkx使用draw画图报错:TypeError: ‘_AxesStack‘ object is not callable

一、问题描述 在使用networkx的draw绘图时nx.draw(g,posnx.spring_layout(g))&#xff0c;报错&#xff1a;TypeError: _AxesStack object is not callable 二、原因 可能是当前python环境下的networkx和matplotlib的版本不匹配。我报错时的networkx2.8&#xff0c;matplotl…

Element UI 偶发性图标乱码问题

1. 问题如图所示 2. 原因&#xff1a;sass版本低 sass: 1.26.8 sass-loader: 8.0.2 3. 解决方法 (1) 提高sass版本 (2) 在vue.config.js中添加配置 css: {loaderOptions: {sass: {sassOptions: {outputStyle: expanded}}}},4. 遇到的问题 升级后打包&#xff0c;报错 Syntax…

Freeswitch中mod_commonds

mod_commands Table of Contents (click to expand) 0. About1. Usage 1.1 CLI1.2 API/Event Interfaces1.3 Scripting Interfaces1.4 From the Dialplan2. Format of returned data3. Core Commands 3.1 acl  3.1.1 Syntax3.1.2 Examples3.2 alias 3.2.1 Syntax3.2.2…

VBA技术资料MF83:将Word文档批量另存为PDF文件

我给VBA的定义&#xff1a;VBA是个人小型自动化处理的有效工具。利用好了&#xff0c;可以大大提高自己的工作效率&#xff0c;而且可以提高数据的准确度。我的教程一共九套&#xff0c;分为初级、中级、高级三大部分。是对VBA的系统讲解&#xff0c;从简单的入门&#xff0c;到…

初始MySQL(六)(自增长,索引,事务,隔离级别)

目录 自增长 索引 索引的原理: mysql索引的类型 添加/删除索引/查看索引 添加索引 删除索引 查看索引(没有生成或者问问什么时候存在) 小结 MySQL事务 关于事务的一些概念 mysql数据库控制台事务的几个重要操作 MySQL事务细节讨论 MySQL事务隔离级别 介绍 数据库…

ElasticSearch 安装(单机版本)

文章目录 ElasticSearch 安装&#xff08;单机版本&#xff09;环境配置下载安装包调整系统参数安装启动并验证 ElasticSearch 安装&#xff08;单机版本&#xff09; 此文档演示 ElasticSearch 的单机版本在 CentOS 7 环境下的安装方式以及相关的配置。 环境配置 Linux 主机一…

Android 14 Beta 1

Android 14的第一个 Beta 版&#xff0c;围绕隐私、安全、性能、开发人员生产力和用户定制等核心主题构建&#xff0c;同时继续改进平板电脑、可折叠设备等大屏幕设备的体验。我们一直在完善 Android 14 的功能和稳定性方面取得稳步进展&#xff0c;现在是时候向开发者和早期采…

C++基础(3)——类与对象

1.构造函数&#xff1a; 1.1 构造函数的引入&#xff1a; 在关于数据结构这一部分的文章中&#xff0c;创建了一个新的数据结构后&#xff0c;通常需要编写一个初始化函数来对这个数据结构进行一次初始化。在C的类中&#xff0c;如果存在函数&#xff0c;同样也需要对函数进行…

传递函数的推导和理解

传递函数的推导和理解 假设有一个线性系统&#xff0c;在一般情况下&#xff0c;它的激励 x ( t ) x(t) x(t)与响应 y ( t ) y(t) y(t)所满足的的关系&#xff0c;可用下列微分方程来表示&#xff1a; a n y ( n ) a n − 1 y ( n − 1 ) a n − 2 y ( n − 2 ) ⋯ a 1 y…

【重点文章】服务升级惨痛教训

文章目录 事故解析:避免方法涉及知识 以前怎么接触过大表&#xff0c;所以alter操作我都是一次性执行好几条的&#xff0c;这几条一下子干过去了   结果就是一直在转圈执行&#xff0c;因为alter产生的是表级排它锁&#xff0c;所以有关这几个表的查询更新操作全部处于阻塞…

CTF-栈溢出-基本ROP-【ret2shellcode】

文章目录 ret2shellcodeHTBCyberSanta 2021 sleigh思路exp ret2shellcode 控制程序去执行我们自己填充的代码。 条件&#xff1a; 我们填充的代码的位置具有可执行权限 HTBCyberSanta 2021 sleigh 检查保护 Has RWX segments提示有可读可写可执行的段 main函数 banner函数…

教师资格证的照片是什么底色?一键替换证件照背景色

现在在报考教师资格证时&#xff0c;我们提交个人资料信息都是在网络上进行的&#xff0c;最关键的一步就是要提交证件照&#xff0c;很多小伙伴还都不太情书教师资格证证件照要求&#xff0c;比如规定的证件照背景色是什么颜色&#xff0c;今天就围绕着这个问题给大家详细说明…

赶快来!程序员接单必须知道的六大注意事项!!!

花花世界迷人眼&#xff0c;增加实力多搞钱&#xff01;对于咱程序员来说&#xff0c;搞钱的最好办法就是网上接单了&#xff0c;相信也有不少小伙伴已经在尝试了吧&#xff01;但是如何正确的搞钱呢&#xff1f;其中的注意事项你真的了解吗&#xff1f; 本期就和小编一起来看…

使用nacos配置中心管理配置文件时,springcloud程序启动报错,无法找到对应的配置文件(加载到了错误的配置文件)

这里写目录标题 一、场景二、关键依赖三、报错信息四、排查1、bootstrap.yml配置2、查看Nacos配置中心3、重启后程序依旧报错&#xff0c;查看启动日志&#xff0c;发现Nacos加载到了错误的配置文件4、Debug查看源码&#xff0c;企图弄清楚使用错误应用名的原因5、找不到使用依…