VB.net读写NDEF标签URI智能海报WIFI蓝牙连接

news2024/11/16 23:55:15

 本示例使用的发卡器:https://item.taobao.com/item.htm?ft=t&id=615391857885

Public Class Form1

    Dim oldpicckey(0 To 5) As Byte  '卡片旧密码
    Dim newpicckey(0 To 5) As Byte  '卡片新密码
   

    Function GetTagUID() As String
        Dim status As Byte
        Dim myctrlword As Byte
        Dim mypiccserial(0 To 7) As Byte
        Dim mypickey(0 To 5) As Byte
        Dim mypicdata(0 To 47) As Byte
        Dim mypiccseriallen(0 To 1) As Byte

        GetTagUID = ""
        myctrlword = 0
        status = piccreadex_ntag(myctrlword, mypiccserial(0), mypickey(0), 4, 1, mypicdata(0))
        If status = 0 Then  'Ntag21x卡   
            For i = 0 To 6
                GetTagUID = GetTagUID + mypiccserial(i).ToString("X02")
            Next
        Else
            status = iso15693readex(myctrlword, 0, 0, 1, mypiccserial(0), mypicdata(0))
            If status = 0 Then  '15693卡
                For i = 0 To 7
                    GetTagUID = GetTagUID + mypiccserial(i).ToString("X02")
                Next
            Else
                myctrlword = 23
                mypickey(0) = "&HFF" : mypickey(1) = "&HFF" : mypickey(2) = "&HFF" : mypickey(3) = "&HFF" : mypickey(4) = "&HFF" : mypickey(5) = "&HFF"
                status = piccreadex(myctrlword, mypiccserial(0), 0, 1, mypickey(0), mypicdata(0))
                If status = 0 Then  'MifareClass卡
                    For i = 0 To 3
                        GetTagUID = GetTagUID + mypiccserial(i).ToString("X02")
                    Next
                Else
                    myctrlword = 23
                    mypickey(0) = "&HA0" : mypickey(1) = "&HA1" : mypickey(2) = "&HA2" : mypickey(3) = "&HA3" : mypickey(4) = "&HA4" : mypickey(5) = "&HA5"
                    status = piccreadex(myctrlword, mypiccserial(0), 0, 1, mypickey(0), mypicdata(0))
                    If status = 0 Then
                        For i = 0 To 3
                            GetTagUID = GetTagUID + mypiccserial(i).ToString("X02")
                        Next
                    Else
                        myctrlword = 0
                        If (forumtype4request(myctrlword, mypiccserial(0), mypiccseriallen(0)) = 0) Or (forumtype4request(myctrlword, mypiccserial(0), mypiccseriallen(0)) = 52) Then
                            For i = 0 To mypiccseriallen(0) - 1 'forumtype4卡
                                GetTagUID = GetTagUID + mypiccserial(i).ToString("X02")
                            Next
                        End If
                    End If
                End If
            End If
        End If
    End Function

    Function checkcardtype() As Integer
        Dim status As Byte
        Dim myctrlword As Byte
        Dim mypiccserial(0 To 7) As Byte
        Dim mypickey(0 To 5) As Byte
        Dim mypicdata(0 To 47) As Byte
        Dim mypiccseriallen(0 To 1) As Byte

        checkcardtype = 0
        myctrlword = 0
        status = piccreadex_ntag(myctrlword, mypiccserial(0), mypickey(0), 4, 1, mypicdata(0))
        If status = 0 Then
            checkcardtype = 1   'Ntag21x卡
        Else
            status = iso15693readex(myctrlword, 0, 0, 1, mypiccserial(0), mypicdata(0))
            If status = 0 Then
                checkcardtype = 2   '15693卡
            Else
                myctrlword = 23
                mypickey(0) = "&HFF" : mypickey(1) = "&HFF" : mypickey(2) = "&HFF" : mypickey(3) = "&HFF" : mypickey(4) = "&HFF" : mypickey(5) = "&HFF"
                status = piccreadex(myctrlword, mypiccserial(0), 0, 1, mypickey(0), mypicdata(0))
                If status = 0 Then
                    checkcardtype = 3   'MifareClass卡
                Else
                    myctrlword = 23
                    mypickey(0) = "&HA0" : mypickey(1) = "&HA1" : mypickey(2) = "&HA2" : mypickey(3) = "&HA3" : mypickey(4) = "&HA4" : mypickey(5) = "&HA5"
                    status = piccreadex(myctrlword, mypiccserial(0), 0, 1, mypickey(0), mypicdata(0))
                    If status = 0 Then
                        checkcardtype = 3
                    Else
                        myctrlword = 0
                        If (forumtype4request(myctrlword, mypiccserial(0), mypiccseriallen(0)) = 0) Or (forumtype4request(myctrlword, mypiccserial(0), mypiccseriallen(0)) = 52) Then
                            checkcardtype = 4   'forumtype4卡
                        Else
                            checkcardtype = 0
                        End If
                    End If
                End If
            End If
        End If
    End Function

    Private Sub NtagPageLock()      '锁定ntag2数据页,锁定后标签不可以再次修改,请谨慎使用锁定功能
        Dim status As Byte
        Dim mypicclockdata(0 To 3) As Byte
        mypicclockdata(0) = "&H00" : mypicclockdata(1) = "&H00" : mypicclockdata(2) = "&HFF" : mypicclockdata(3) = "&HFF"
        status = picclock_ntag(0, mypicclockdata(0))    '静态锁

        mypicclockdata(0) = "&HFF" : mypicclockdata(1) = "&HFF" : mypicclockdata(2) = "&HFF" : mypicclockdata(3) = "&H00"
        status = picclock_ntag(1, mypicclockdata(0))    '动态锁
    End Sub

    Private Sub NtagKeyEn(ByRef mypiccserial As Byte, ByVal havekey As Boolean, ByVal addkey As Boolean)  '开启或关ntag2x卡密码保护功能
        Dim myctrlword As Byte
        Dim status As Byte
        Dim mypiccdata(0 To 15) As Byte

        If havekey Then     '卡片已经有密码保护
            myctrlword = "&H10"
        Else
            myctrlword = 0
        End If

        If addkey Then      '开启卡密码保护功能
            mypiccdata(0) = 0 : mypiccdata(1) = 0 : mypiccdata(2) = 0 : mypiccdata(3) = 4       '密码保护起始页
            myctrlword = myctrlword + 1
            mypiccdata(4) = 0 / 8   '认证次数
            mypiccdata(5) = 0 : mypiccdata(6) = 0 : mypiccdata(7) = 0   '启用计数器
            myctrlword = myctrlword + 2
            For i = 0 To 3
                mypiccdata(8 + i) = newpicckey(i)
            Next
            mypiccdata(12) = "&H16" : mypiccdata(13) = "&H16" : mypiccdata(14) = 0 : mypiccdata(15) = 0
            myctrlword = myctrlword + 4
        Else
            mypiccdata(0) = 0 : mypiccdata(1) = 0 : mypiccdata(2) = 0 : mypiccdata(3) = "&HFF"
            myctrlword = myctrlword + 1
            mypiccdata(4) = 0 : mypiccdata(5) = 0 : mypiccdata(6) = 0 : mypiccdata(7) = 0
            myctrlword = myctrlword + 2
        End If
        status = piccinit_ntag(myctrlword, mypiccserial, oldpicckey(0), mypiccdata(0))

    End Sub

    Private Sub button4_Click(sender As Object, e As EventArgs) Handles button4.Click
        Dim xms As Integer
        xms = 50
        Dim status As Byte = pcdbeep(xms)
        If status <> 0 Then
            disperrinf(status)
        End If
    End Sub

    Private Sub button8_Click(sender As Object, e As EventArgs) Handles button8.Click
        Dim status As Byte   '存放返回值
        Dim devno(3) As Byte '设备编号
        status = pcdgetdevicenumber(devno(0))

        If status = 0 Then
            MsgBox("设备编号:" + devno(0).ToString("D3") + "-" + devno(1).ToString("D3") + "-" + devno(2).ToString("D3") + "-" + devno(3).ToString("D3"), vbInformation + vbOKOnly, "提示")
        Else
            disperrinf(status)
        End If
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        oldpicckey(0) = "&H19" : oldpicckey(1) = "&H74" : oldpicckey(2) = "&H02" : oldpicckey(3) = "&H02" : oldpicckey(4) = "&H01" : oldpicckey(5) = "&H11"
        newpicckey(0) = "&H19" : newpicckey(1) = "&H74" : newpicckey(2) = "&H02" : newpicckey(3) = "&H02" : newpicckey(4) = "&H01" : newpicckey(5) = "&H11" '为防止测试中忘记以设定的密码,标签统一用此组密码加密,客户可自行设置其他的标签保护密码

        comboBox1.SelectedIndex = 2
        comboBox2.SelectedIndex = 7
        comboBox3.SelectedIndex = 4
        comboBox4.SelectedIndex = 3
    End Sub

    Private Sub WriteDataBufToTag(ByVal NDEFinfo As String, ByVal havelock As Boolean, ByVal keyEn As Boolean)
        Dim status As Byte
        Dim afi As Byte
        Dim i As Integer
        Dim myctrlword As Byte              '控制字
        Dim mypiccserial(0 To 7) As Byte    '卡序列号
        Dim mypiccseriallen(0 To 1) As Byte
        Dim carduid As String

        Dim cardtype As Byte = checkcardtype()
        Select Case cardtype
            Case 1  'Ntag2x标签
                If havelock Then myctrlword = "&H10" Else myctrlword = 0
                status = forumtype2_write_ndeftag(myctrlword, mypiccserial(0), oldpicckey(0))
                If status = 0 Then
                    If CheckBox5.Checked = False Then NtagKeyEn(mypiccserial(0), havelock, keyEn) '开启或关闭Ntag2x标签密码保护功能
                    'If (keyEn) Then NtagPageLock() '锁定Ntag2标签数据块,锁定后不可再改修改,请谨慎使用
                    pcdbeep(38)
                    carduid = "Ntag2UID:"
                    For i = 0 To 6
                        carduid = carduid + mypiccserial(i).ToString("X02")
                    Next
                    MessageBox.Show(carduid + "," + NDEFinfo + "写入成功!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Else
                    disperrinf(status)
                End If

            Case 2  '15693标签
                myctrlword = 0
                afi = 0
                status = forumtype5_write_ndeftag(myctrlword, afi, mypiccserial(0))
                If status = 0 Then
                    'If (keyEn) Then iso15693lockblock(34, 1, mypiccserial(0)) '15693卡锁定块数据后只能读取不可再修改,为防止卡片锁死,仅在确定需要才开启此段代码。
                    pcdbeep(38)
                    carduid = "15693UID:"
                    For i = 0 To 7
                        carduid = carduid + mypiccserial(i).ToString("X02")
                    Next
                    MessageBox.Show(carduid + "," + NDEFinfo + "写入成功!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Else
                    disperrinf(status)
                End If

            Case 3  'MifareClass标签
                If havelock Then myctrlword = 208 Else myctrlword = 144
                If keyEn Then myctrlword = myctrlword + 4
                status = piccwrite_ndeftag(myctrlword, mypiccserial(0), oldpicckey(0), newpicckey(0))
                If status = 0 Then
                    pcdbeep(38)
                    carduid = "MifareClassUID:"
                    For i = 0 To 3
                        carduid = carduid + mypiccserial(i).ToString("X02")
                    Next
                    MessageBox.Show(carduid + "," + NDEFinfo + "写入成功!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Else
                    disperrinf(status)
                End If

            Case 4  'ForumType4标签
                myctrlword = 0     '0表示标签无密码,如设置密码取值  &H40 ,mypicckey 存放密码
                status = forumtype4_write_ndeftag(myctrlword, mypiccserial(0), mypiccseriallen(0), newpicckey(0))
                If status = 0 Then
                    pcdbeep(38)
                    carduid = "ForumType4UID:"
                    For i = 0 To mypiccseriallen(0) - 1
                        carduid = carduid + mypiccserial(i).ToString("X02")
                    Next
                    MessageBox.Show(carduid + "," + NDEFinfo + "写入成功!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Else
                    disperrinf(status)
                End If

            Case Else
                MessageBox.Show("请刷有效的NFC标签!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Select
    End Sub

    Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
        Dim status As Byte
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = checkBox2.Checked        '是否启用密码保护写入的NDEF信息

        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲        

        Dim languagecodestr As String = "en"    '语言编码,英文为en,中文为zh
        Dim languagecodestrlen As Integer = languagecodestr.Length

        Dim textstr As String = textBox1.Text.Trim
        Dim textstrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(textstr).Length

        status = tagbuf_addtext(languagecodestr, languagecodestrlen, textstr, textstrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF纯文本标签数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            WriteDataBufToTag("NDEF纯文本标签", havelock, keyEn)
        End If
    End Sub

    Private Sub button3_Click(sender As Object, e As EventArgs) Handles button3.Click
        Dim status As Byte
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = checkBox2.Checked        '是否启用密码保护写入的NDEF信息
        Dim taguidstr As String = ""

        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲        

        If CheckBox5.Checked Then
            taguidstr = "?uid=" & GetTagUID()
        End If

        Dim languagecodestr As String = "en"    '语言编码,英文为en,中文为zh
        Dim languagecodestrlen As Integer = languagecodestr.Length

        Dim titlestr As String = textBox4.Text.Trim     '标题
        Dim titlestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(titlestr).Length    '标题长度
        Dim uriheaderindex As Integer = comboBox1.SelectedIndex '前缀
        Dim uristr As String = textBox5.Text.Trim & taguidstr   'uri
        Dim uristrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(uristr).Length 'uri长度
        Dim ntag21xmirrorbuf(0 To 6) As Byte    'Ntag21x UID或计数器镜像功能配置值缓冲
        Dim i As Integer
        ntag21xmirrorbuf(0) = 0
        If CheckBox3.Checked Then   '启用UID镜像
            ntag21xmirrorbuf(0) = ntag21xmirrorbuf(0) + "&H40"
        End If
        If CheckBox4.Checked Then
            ntag21xmirrorbuf(0) = ntag21xmirrorbuf(0) + "&H80"
        End If
        For i = 1 To 6
            ntag21xmirrorbuf(i) = Asc("0")
        Next

        If ntag21xmirrorbuf(0) > 0 Then
            status = tagbuf_adduri1(languagecodestr, languagecodestrlen, titlestr, titlestrlen, uriheaderindex, uristr, uristrlen, ntag21xmirrorbuf(0))   '可以用此方法写入多条记录到数据缓冲
        Else
            status = tagbuf_adduri(languagecodestr, languagecodestrlen, titlestr, titlestrlen, uriheaderindex, uristr, uristrlen)   '可以用此方法写入多条记录到数据缓冲
        End If

        If status <> 0 Then
            MessageBox.Show("生成NDEF智能海报数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            WriteDataBufToTag("NDEF智能海报标签", havelock, keyEn)
        End If
    End Sub

    Private Sub button5_Click(sender As Object, e As EventArgs) Handles button5.Click
        Dim status As Byte
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = checkBox2.Checked        '是否启用密码保护写入的NDEF信息

        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲        

        Dim languagecodestr As String = "en"    '语言编码,英文为en,中文为zh
        Dim languagecodestrlen As Integer = languagecodestr.Length

        Dim titlestr As String = textBox7.Text.Trim     '标题
        Dim titlestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(titlestr).Length    '标题长度
        Dim uriheaderindex As Integer = 0 '地理位置没有链接前缀
        Dim uristr As String = "geo:" + textBox6.Text.Trim + "," + textBox8.Text.Trim   'uri
        Dim uristrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(uristr).Length 'uri长度

        status = tagbuf_adduri(languagecodestr, languagecodestrlen, titlestr, titlestrlen, uriheaderindex, uristr, uristrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF地图坐标数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            WriteDataBufToTag("NDEF地图坐标标签", havelock, keyEn)
        End If
    End Sub

    Private Sub button6_Click(sender As Object, e As EventArgs) Handles button6.Click
        Dim status As Byte
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = checkBox2.Checked        '是否启用密码保护写入的NDEF信息

        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲        

        Dim languagecodestr As String = "en"    '语言编码,英文为en,中文为zh
        Dim languagecodestrlen As Integer = languagecodestr.Length

        Dim titlestr As String = ""     '标题
        Dim titlestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(titlestr).Length    '标题长度
        Dim uriheaderindex As Integer = 5 '呼叫电话的链接前缀为5
        Dim uristr As String = textBox9.Text.Trim   'uri呼叫电话
        Dim uristrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(uristr).Length 'uri长度

        status = tagbuf_adduri(languagecodestr, languagecodestrlen, titlestr, titlestrlen, uriheaderindex, uristr, uristrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF呼叫电话数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            WriteDataBufToTag("NDEF呼叫电话标签", havelock, keyEn)
        End If
    End Sub

    Private Sub button7_Click(sender As Object, e As EventArgs) Handles button7.Click
        Dim status As Byte
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = checkBox2.Checked        '是否启用密码保护写入的NDEF信息

        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲        

        Dim infostr As String = "BEGIN:VCARD" & Chr(10)    '
        infostr = infostr + "VERSION:3.0" & Chr(10)
        infostr = infostr + "FN:" + textBox12.Text.Trim() & Chr(10)   '姓名
        infostr = infostr + "TEL:" + textBox11.Text.Trim() & Chr(10)  '电话
        infostr = infostr + "ORG:" + textBox10.Text.Trim() & Chr(10)  '单位名称
        infostr = infostr + "ADR:" + textBox15.Text.Trim() & Chr(10)  '地址
        infostr = infostr + "EMAIL:" + textBox13.Text.Trim() & Chr(10) '邮箱
        infostr = infostr + "URL:" + textBox14.Text.Trim() & Chr(10)  '官网
        infostr = infostr + "END:VCARD" & Chr(10)
        Dim infostrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(infostr).Length '名片长度

        status = tagbuf_addbusinesscard(infostr, infostrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF电子名片数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            WriteDataBufToTag("NDEF电子名片标签", havelock, keyEn)
        End If
    End Sub

    Private Sub button9_Click(sender As Object, e As EventArgs) Handles button9.Click
        Dim status As Byte
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = checkBox2.Checked        '是否启用密码保护写入的NDEF信息

        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲        

        Dim ssidstr As String = textBox16.Text.Trim    '热点名称        
        Dim ssidstrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(ssidstr).Length '热点名称长度
        Dim authtype As Integer = comboBox2.SelectedIndex '认证方式
        Dim crypttype As Integer = comboBox3.SelectedIndex '加密算法
        Dim keystr As String = textBox17.Text.Trim '密码
        Dim keystrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(keystr).Length '密码长度

        status = tagbuf_addwifi(ssidstr, ssidstrlen, authtype, crypttype, keystr, keystrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF无线连接数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            WriteDataBufToTag("NDEF无线连接标签", havelock, keyEn)
        End If
    End Sub

    Private Sub button10_Click(sender As Object, e As EventArgs) Handles button10.Click
        Dim status As Byte
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = checkBox2.Checked        '是否启用密码保护写入的NDEF信息

        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲        

        Dim blenamestr As String = textBox19.Text.Trim    '设备名称        
        Dim blenamestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(blenamestr).Length '设备名称长度

        Dim macstr() As String = Split(textBox18.Text.Trim, ":")
        Dim macbuf(0 To 5) As Byte
        Try
            macbuf(0) = "&H" & macstr(0)
            macbuf(1) = "&H" & macstr(1)
            macbuf(2) = "&H" & macstr(2)
            macbuf(3) = "&H" & macstr(3)
            macbuf(4) = "&H" & macstr(4)
            macbuf(5) = "&H" & macstr(5)
        Catch ex As Exception
            MessageBox.Show("蓝牙设备的MAC地址输入错误,请输入正确的MAC地址!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
            textBox18.Select()
        End Try

        status = tagbuf_addbluetooth(blenamestr, blenamestrlen, macbuf(0))   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF蓝牙连接数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            WriteDataBufToTag("NDEF蓝牙连接标签", havelock, keyEn)
        End If
    End Sub

    Private Sub comboBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles comboBox4.SelectedIndexChanged
        Dim appstr() As String = Split(comboBox4.Text.Trim, ":")
        textBox20.Text = appstr(1)
    End Sub

    Private Sub button11_Click(sender As Object, e As EventArgs) Handles button11.Click
        Dim status As Byte
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = checkBox2.Checked        '是否启用密码保护写入的NDEF信息

        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲        

        Dim packagestr As String = textBox20.Text.Trim    'APP名称        
        Dim packagestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(packagestr).Length 'APP名称长度

        status = tagbuf_addapp(packagestr, packagestrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF启动应用数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            WriteDataBufToTag("NDEF启动应用标签", havelock, keyEn)
        End If
    End Sub

    Private Sub button2_Click(sender As Object, e As EventArgs) Handles button2.Click
        Dim status As Byte
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = checkBox2.Checked        '是否启用密码保护写入的NDEF信息

        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲        

        Dim typestr As String = textBox2.Text.Trim    '数据类型 
        Dim typestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(typestr).Length '数据类型长度

        Dim datastr As String = textBox3.Text.Trim    '数据
        Dim datastrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(datastr).Length '数据长度

        status = tagbuf_adddata(typestr, typestrlen, datastr, datastrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF数据标签缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            WriteDataBufToTag("NDEF数据标签", havelock, keyEn)
        End If
    End Sub

    Private Sub button12_Click(sender As Object, e As EventArgs) Handles button12.Click
        Dim status As Byte
        Dim afi As Byte
        Dim myctrlword As Byte
        Dim mypiccserial(0 To 7) As Byte
        Dim mypiccseriallen(0 To 1) As Byte
        Dim revstrlen(0 To 1) As Byte
        Dim recordnumber(0 To 1) As Byte
        Dim mypiccdata(0 To 2047) As Byte
        Dim carduid As String = ""
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护

        textBox21.Text = ""
        status = 255
        Dim cardtype As Byte = checkcardtype()
        Select Case cardtype
            Case 1  'Ntag2x标签
                If havelock Then myctrlword = "&H10" Else myctrlword = 0
                status = forumtype2_read_ndeftag(myctrlword, mypiccserial(0), oldpicckey(0))
                carduid = "Ntag2UID:"
                For i = 0 To 6
                    carduid = carduid + mypiccserial(i).ToString("X02")
                Next

            Case 2  '15693标签
                myctrlword = 0
                afi = 0
                status = forumtype5_read_ndeftag(myctrlword, afi, mypiccserial(0))
                carduid = "15693UID:"
                For i = 0 To 7
                    carduid = carduid + mypiccserial(i).ToString("X02")
                Next

            Case 3  'MifareClass标签
                myctrlword = 144
                status = piccread_ndeftag(myctrlword, mypiccserial(0), oldpicckey(0))
                carduid = "MifareClassUID:"
                For i = 0 To 3
                    carduid = carduid + mypiccserial(i).ToString("X02")
                Next

            Case 4  'ForumType4标签
                myctrlword = 0     '0表示标签无密码,如设置密码取值  &H40 ,mypicckey 存放密码
                status = forumtype4_read_ndeftag(myctrlword, mypiccserial(0), mypiccseriallen(0), oldpicckey(0))
                carduid = "ForumType4UID:"
                For i = 0 To mypiccseriallen(0) - 1
                    carduid = carduid + mypiccserial(i).ToString("X02")
                Next

            Case Else
                MessageBox.Show("请刷有效的NFC标签!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Select

        If status = 0 Then
            pcdbeep(38)
            tagbuf_read(mypiccdata(0), revstrlen(0), recordnumber(0))
            Dim ndefstr As String = System.Text.Encoding.Default.GetString(mypiccdata)
            textBox21.Text = carduid & Chr(13) & Chr(10) & ndefstr
        End If
    End Sub

    Private Sub button13_Click(sender As Object, e As EventArgs) Handles button13.Click
        Dim status As Byte
        Dim afi As Byte
        Dim i As Integer
        Dim myctrlword As Byte              '控制字
        Dim mypiccserial(0 To 7) As Byte    '卡序列号
        Dim mypiccseriallen(0 To 1) As Byte
        Dim carduid As String
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = False            '清空标签,强制清空密钥

        checkBox2.Checked = False               '清空标签,强制清空密钥

        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲  

        Dim cardtype As Byte = checkcardtype()
        Select Case cardtype
            Case 1  'Ntag2x标签
                If havelock Then myctrlword = "&H10" Else myctrlword = 0
                status = forumtype2_write_ndeftag(myctrlword, mypiccserial(0), oldpicckey(0))
                If status = 0 Then
                    NtagKeyEn(mypiccserial(0), havelock, keyEn)   '开启或关闭Ntag2x标签密码保护功能

                    pcdbeep(38)
                    carduid = "Ntag2UID:"
                    For i = 0 To 6
                        carduid = carduid + mypiccserial(i).ToString("X02")
                    Next
                    MessageBox.Show(carduid + ",NDEF标签信息已清空!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Else
                    disperrinf(status)
                End If

            Case 2  '15693标签
                myctrlword = 0
                afi = 0
                status = forumtype5_write_ndeftag(myctrlword, afi, mypiccserial(0))
                If status = 0 Then
                    pcdbeep(38)
                    carduid = "15693UID:"
                    For i = 0 To 7
                        carduid = carduid + mypiccserial(i).ToString("X02")
                    Next
                    MessageBox.Show(carduid + ",NDEF标签信息已清空!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Else
                    disperrinf(status)
                End If

            Case 3  'MifareClass标签
                If havelock Then myctrlword = 210 Else myctrlword = 146
                status = piccclear_ndeftag(myctrlword, mypiccserial(0), oldpicckey(0))
                If status = 0 Then
                    pcdbeep(38)
                    carduid = "MifareClassUID:"
                    For i = 0 To 3
                        carduid = carduid + mypiccserial(i).ToString("X02")
                    Next
                    MessageBox.Show(carduid + ",NDEF标签信息已清空!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Else
                    disperrinf(status)
                End If

            Case 4  'ForumType4标签
                myctrlword = 0     '0表示标签无密码,如设置密码取值  &H40 ,mypicckey 存放密码
                status = forumtype4_write_ndeftag(myctrlword, mypiccserial(0), mypiccseriallen(0), oldpicckey(0))
                If status = 0 Then
                    pcdbeep(38)
                    carduid = "ForumType4UID:"
                    For i = 0 To mypiccseriallen(0) - 1
                        carduid = carduid + mypiccserial(i).ToString("X02")
                    Next
                    MessageBox.Show(carduid + ",NDEF标签信息已清空!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Else
                    disperrinf(status)
                End If

            Case Else
                MessageBox.Show("请刷有效的NFC标签!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Select
    End Sub

    Private Sub Button23_Click(sender As Object, e As EventArgs) Handles Button23.Click
        tagbuf_forumtype4_clear()   '清空现有标签数据缓冲
        tagbuf_clear()              '清空现有标签数据缓冲
        MessageBox.Show("NDEF数据缓冲已经清除!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
    End Sub

    Private Sub Button24_Click(sender As Object, e As EventArgs) Handles Button24.Click
        Dim havelock As Boolean = checkBox1.Checked     '卡片是否已加密保护
        Dim keyEn As Boolean = checkBox2.Checked        '是否启用密码保护写入的NDEF信息

        WriteDataBufToTag("NDEF组合标签", havelock, keyEn)
    End Sub

    Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click
        Dim status As Byte
        Dim languagecodestr As String = "en"    '语言编码,英文为en,中文为zh
        Dim languagecodestrlen As Integer = languagecodestr.Length

        Dim textstr As String = textBox1.Text.Trim
        Dim textstrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(textstr).Length

        status = tagbuf_addtext(languagecodestr, languagecodestrlen, textstr, textstrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF纯文本标签数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            MessageBox.Show("    生成NDEF纯文本标签数据缓冲成功,可以向缓冲区继续添加记录,也可以将缓冲区内数据写标签。", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click
        Dim status As Byte

        Dim languagecodestr As String = "en"    '语言编码,英文为en,中文为zh
        Dim languagecodestrlen As Integer = languagecodestr.Length

        Dim titlestr As String = textBox4.Text.Trim     '标题
        Dim titlestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(titlestr).Length    '标题长度
        Dim uriheaderindex As Integer = comboBox1.SelectedIndex '前缀
        Dim uristr As String = textBox5.Text.Trim   'uri
        Dim uristrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(uristr).Length 'uri长度
        
        status = tagbuf_adduri(languagecodestr, languagecodestrlen, titlestr, titlestrlen, uriheaderindex, uristr, uristrlen)   '可以用此方法写入多条记录到数据缓冲

        If status <> 0 Then
            MessageBox.Show("生成NDEF智能海报数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            MessageBox.Show("    生成NDEF智能海报数据缓冲成功,可以向缓冲区继续添加记录,也可以将缓冲区内数据写标签。", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Private Sub Button16_Click(sender As Object, e As EventArgs) Handles Button16.Click
        Dim status As Byte

        Dim languagecodestr As String = "en"    '语言编码,英文为en,中文为zh
        Dim languagecodestrlen As Integer = languagecodestr.Length

        Dim titlestr As String = textBox7.Text.Trim     '标题
        Dim titlestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(titlestr).Length    '标题长度
        Dim uriheaderindex As Integer = 0 '地理位置没有链接前缀
        Dim uristr As String = "geo:" + textBox6.Text.Trim + "," + textBox8.Text.Trim   'uri
        Dim uristrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(uristr).Length 'uri长度

        status = tagbuf_adduri(languagecodestr, languagecodestrlen, titlestr, titlestrlen, uriheaderindex, uristr, uristrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF地图坐标数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            MessageBox.Show("    生成NDEF地图坐标数据缓冲成功,可以向缓冲区继续添加记录,也可以将缓冲区内数据写标签。", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Private Sub Button17_Click(sender As Object, e As EventArgs) Handles Button17.Click
        Dim status As Byte

        Dim languagecodestr As String = "en"    '语言编码,英文为en,中文为zh
        Dim languagecodestrlen As Integer = languagecodestr.Length

        Dim titlestr As String = ""     '标题
        Dim titlestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(titlestr).Length    '标题长度
        Dim uriheaderindex As Integer = 5 '呼叫电话的链接前缀为5
        Dim uristr As String = textBox9.Text.Trim   'uri呼叫电话
        Dim uristrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(uristr).Length 'uri长度

        status = tagbuf_adduri(languagecodestr, languagecodestrlen, titlestr, titlestrlen, uriheaderindex, uristr, uristrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF呼叫电话数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            MessageBox.Show("    生成NDEF呼叫电话数据缓冲成功,可以向缓冲区继续添加记录,也可以将缓冲区内数据写标签。", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Private Sub Button18_Click(sender As Object, e As EventArgs) Handles Button18.Click
        Dim status As Byte

        Dim infostr As String = "BEGIN:VCARD" & Chr(10)    '
        infostr = infostr + "VERSION:3.0" & Chr(10)
        infostr = infostr + "FN:" + textBox12.Text.Trim() & Chr(10)   '姓名
        infostr = infostr + "TEL:" + textBox11.Text.Trim() & Chr(10)  '电话
        infostr = infostr + "ORG:" + textBox10.Text.Trim() & Chr(10)  '单位名称
        infostr = infostr + "ADR:" + textBox15.Text.Trim() & Chr(10)  '地址
        infostr = infostr + "EMAIL:" + textBox13.Text.Trim() & Chr(10) '邮箱
        infostr = infostr + "URL:" + textBox14.Text.Trim() & Chr(10)  '官网
        infostr = infostr + "END:VCARD" & Chr(10)
        Dim infostrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(infostr).Length '名片长度

        status = tagbuf_addbusinesscard(infostr, infostrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF电子名片数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            MessageBox.Show("    生成NDEF电子名片数据缓冲成功,可以向缓冲区继续添加记录,也可以将缓冲区内数据写标签。", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Private Sub Button19_Click(sender As Object, e As EventArgs) Handles Button19.Click
        Dim status As Byte

        Dim ssidstr As String = textBox16.Text.Trim    '热点名称        
        Dim ssidstrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(ssidstr).Length '热点名称长度
        Dim authtype As Integer = comboBox2.SelectedIndex '认证方式
        Dim crypttype As Integer = comboBox3.SelectedIndex '加密算法
        Dim keystr As String = textBox17.Text.Trim '密码
        Dim keystrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(keystr).Length '密码长度

        status = tagbuf_addwifi(ssidstr, ssidstrlen, authtype, crypttype, keystr, keystrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成WIFI无线连接数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            MessageBox.Show("    生成WIFI无线连接数据缓冲成功,可以向缓冲区继续添加记录,也可以将缓冲区内数据写标签。", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Private Sub Button20_Click(sender As Object, e As EventArgs) Handles Button20.Click
        Dim status As Byte

        Dim blenamestr As String = textBox19.Text.Trim    '设备名称        
        Dim blenamestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(blenamestr).Length '设备名称长度

        Dim macstr() As String = Split(textBox18.Text.Trim, ":")
        Dim macbuf(0 To 5) As Byte
        Try
            macbuf(0) = "&H" & macstr(0)
            macbuf(1) = "&H" & macstr(1)
            macbuf(2) = "&H" & macstr(2)
            macbuf(3) = "&H" & macstr(3)
            macbuf(4) = "&H" & macstr(4)
            macbuf(5) = "&H" & macstr(5)
        Catch ex As Exception
            MessageBox.Show("蓝牙设备的MAC地址输入错误,请输入正确的MAC地址!", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
            textBox18.Select()
        End Try

        status = tagbuf_addbluetooth(blenamestr, blenamestrlen, macbuf(0))   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF蓝牙连接数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            MessageBox.Show("    生成NDEF蓝牙连接数据缓冲成功,可以向缓冲区继续添加记录,也可以将缓冲区内数据写标签。", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Private Sub Button21_Click(sender As Object, e As EventArgs) Handles Button21.Click
        Dim status As Byte

        Dim packagestr As String = textBox20.Text.Trim    'APP名称        
        Dim packagestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(packagestr).Length 'APP名称长度

        status = tagbuf_addapp(packagestr, packagestrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF启动应用数据缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            MessageBox.Show("    生成NDEF启动应用数据缓冲成功,可以向缓冲区继续添加记录,也可以将缓冲区内数据写标签。", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Private Sub Button22_Click(sender As Object, e As EventArgs) Handles Button22.Click
        Dim status As Byte

        Dim typestr As String = textBox2.Text.Trim    '数据类型 
        Dim typestrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(typestr).Length '数据类型长度

        Dim datastr As String = textBox3.Text.Trim    '数据
        Dim datastrlen As Integer = System.Text.Encoding.GetEncoding(936).GetBytes(datastr).Length '数据长度

        status = tagbuf_adddata(typestr, typestrlen, datastr, datastrlen)   '可以用此方法写入多条记录到数据缓冲
        If status <> 0 Then
            MessageBox.Show("生成NDEF数据标签缓冲时返回码错误代码:" + status, "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            MessageBox.Show("    生成NDEF数据标签缓冲成功,可以向缓冲区继续添加记录,也可以将缓冲区内数据写标签。", "示例提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Private Sub disperrinf(ByVal errcode As Byte)
        Select Case errcode
            Case 1
                MessageBox.Show("错误代码:" + errcode.ToString() + ",0~2块都没读出来,可能刷卡太块。但卡序列号已被读出来!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 2
                MessageBox.Show("错误代码:" + errcode.ToString() + ",第0块已被读出,但1~2块读取失败。卡序列号已被读出来!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 3
                MessageBox.Show("错误代码:" + errcode.ToString() + ",第0、1块已被读出,但2块读取失败。卡序列号已被读出来!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 8
                MessageBox.Show("错误代码:" + errcode.ToString() + ",未寻到卡,请重新拿开卡后再放到感应区!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 9
                MessageBox.Show("错误代码:" + errcode.ToString() + ",寻卡过程中防冲突失败,读序列吗错误!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 10
                MessageBox.Show("错误代码:" + errcode.ToString() + ",该卡可能已被休眠,无法选中卡片!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 11
                MessageBox.Show("错误代码:" + errcode.ToString() + ",密码装载失败!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 12
                MessageBox.Show("错误代码:" + errcode.ToString() + ",标签密码认证错误!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 13
                MessageBox.Show("错误代码:" + errcode.ToString() + ",读标签失败,原因是刷卡太快或本块所对应的区还没通过密码认证!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 14
                MessageBox.Show("错误代码:" + errcode.ToString() + ",写标签失败,可能需要验证密码!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 21
                MessageBox.Show("错误代码:" + errcode.ToString() + ",没有动态库!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 22
                MessageBox.Show("错误代码:" + errcode.ToString() + ",动态库或驱动程序异常!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 23
                MessageBox.Show("错误代码:" + errcode.ToString() + ",未检测到发卡器!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 24
                MessageBox.Show("错误代码:" + errcode.ToString() + ",操作超时,一般是动态库没有反映!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 25
                MessageBox.Show("错误代码:" + errcode.ToString() + ",发送字数不够!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 26
                MessageBox.Show("错误代码:" + errcode.ToString() + ",发送的CRC错!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 27
                MessageBox.Show("错误代码:" + errcode.ToString() + ",接收的字数不够!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 28
                MessageBox.Show("错误代码:" + errcode.ToString() + ",接收的CRC错!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 45
                MessageBox.Show("错误代码:" + errcode.ToString() + ",此卡不支持更改UID号或UID块已被锁定!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 46
                MessageBox.Show("错误代码:" + errcode.ToString() + ",标签存储空间不足!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case 254
                MessageBox.Show("错误代码:" + errcode.ToString() + ",标签存储空间不足!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
            Case Else
                MessageBox.Show("错误代码:" + errcode.ToString() + ",未知错误!", "Note:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
        End Select
    End Sub
End Class

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

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

相关文章

Android手机投屏方案实现方式对比

文章目录 1.概述2.术语解释2.1 miracast2.2 scrcpy2.4 Wifi Direct2.5 app_process 3.技术实现对比3.1 Miracast3.1.1 Miracast介绍3.1.2 Miracast原理3.1.3 Miracast优缺点分析 3.2 Scrcpy3.2.1 scrcpy 介绍3.2.2 scrcpy的实现原理3.2.3 scrcpy的优缺点分析 3.3 Google cast3.…

Nisshinbo日清纺pvs1114太阳模拟器手测

Nisshinbo日清纺pvs1114太阳模拟器手测

影响上证50股指期货价格的因素有哪些?

上证50股指期货&#xff0c;作为反映上海证券交易所最具代表性50只股票整体表现的期货合约&#xff0c;其价格同样受到一系列复杂因素的驱动。以下是对影响上证50股指期货价格的主要因素进行的详细分析。 因素一、期货合约的供求关系 股指期货市场是一个由多头和空头双方共同…

关于AI副业,能说的都说了(最核心3大赛道、机会、方向)

AI&#xff0c;是生产力工具~ AI&#xff0c;也是焦虑和痛点 一直有小伙伴在问AI副业的事儿&#xff0c;之前也分享过很多。 但是&#xff0c;很多人对AI于副业的作用&#xff0c;过于表面和形式&#xff0c;所以&#xff0c;狂金来叨叨一下最核心的3大赛道&#xff0c;希望…

腾讯云SDK购买流程

音视频终端 SDK 需购买对应 License/套餐获得使用授权&#xff0c;本文将对购买 License/套餐的操作进行详细指引。 您可首先参考计费概述 确认您需要购买的内容&#xff0c;随后参考本文进行购买。本文仅提供 SDK 授权费用所需资源的购买&#xff0c;如果您需要使用其他相关云…

深入浅出MySQL事务处理:从基础概念到ACID特性及并发控制

1、什么是事务 在实际的业务开发中&#xff0c;有些业务操作要多次访问数据库。一个业务要发送多条SQL语句给数据库执行。需要将多次访问数据库的操作视为一个整体来执行&#xff0c;要么所有的SQL语句全部执行成功。如果其中有一条SQL语句失败&#xff0c;就进行事务的回滚&a…

回答网友一个数据显示的问题

事情是这个样子的 俺在一个C# 群里&#xff0c;一个问:"打开form2&#xff0c;可以同步显示form1的表格内容&#xff0c;在form2增删改表格内容之后&#xff0c;可以同步到form1中"。 俺 打开 delphi 放了几个 数据敏感 控件&#xff0c;演示了一下。还说了 一行…

Windows环境下训练开源图像超分项目 ECBSR 教程

ECBSR 介绍 ECBSR&#xff08;Edge-oriented Convolution Block for Real-time Super Resolution&#xff09;是一种针对移动设备设计的轻量级超分辨率网络。它的核心是一种可重参数化的构建模块&#xff0c;称为边缘导向卷积块&#xff08;ECB&#xff09;&#xff0c;这种模…

数集相等定义凸显“R各元x的对应x+1的全体=R”是几百年重大错误

黄小宁 变量x所取各数也均由x代表&#xff0c;x代表其变域&#xff08;x所有能取的数组成的集&#xff09;内任一元。设集A&#xff5b;x&#xff5d;表A各元均由x代表&#xff0c;&#xff5b;x&#xff5d;中变量x的变域是A。其余类推。因各数x可是数轴上点的坐标所以x∈R变换…

详解ES5中的数组方法

7.9 ES5中的数组方法 ECMAScript 5定义了9个新的数组方法来遍历、映射、过滤、检测、简化、搜索数组。 7.9.1 forEach() 7.9.2 map() 将调用的数组的每个元素传递给指定的函数&#xff0c;并返回一个数组&#xff0c;包含函数的返回值。 例如数组的每个元素的立方&#xf…

基于SpringBoot+Vue的大学生勤工助学兼职管理系统

作者&#xff1a;计算机学姐 开发技术&#xff1a;SpringBoot、SSM、Vue、MySQL、JSP、ElementUI、Python、小程序等&#xff0c;“文末源码”。 专栏推荐&#xff1a;前后端分离项目源码、SpringBoot项目源码、Vue项目源码、SSM项目源码 精品专栏&#xff1a;Java精选实战项目…

【优选算法】(第八篇)

目录 串联所有单词的⼦串&#xff08;hard&#xff09; 题目解析 讲解算法原理 编写代码 最⼩覆盖⼦串&#xff08;hard&#xff09; 题目解析 讲解算法原理 编写代码 串联所有单词的⼦串&#xff08;hard&#xff09; 题目解析 1.题目链接&#xff1a;. - 力扣&#…

防砸安全鞋这样挑,舒适又安心!

在复杂多变的工作环境中&#xff0c;安全始终放在首位&#xff0c;特别是对于那些在工地、车间等危险环境中工作的朋友们来说&#xff0c;一双好的防砸安全鞋无疑是工作中的“守护神”。然而&#xff0c;市面上的防砸安全鞋种类繁多&#xff0c;如何挑选一双既舒适又安心的鞋子…

unreal engine5制作动作类游戏时,我们使用刀剑等武器攻击怪物或敌方单位时,发现攻击特效、伤害等没有触发

UE5系列文章目录 文章目录 UE5系列文章目录前言一、问题分析二、解决方法1. 添加项目设置碰撞检测通道2.玩家角色碰撞设置3.怪物角色碰撞预设 最终效果 前言 在使用unreal engine5制作动作类游戏时&#xff0c;我们使用刀剑等武器攻击怪物或敌方单位时&#xff0c;发现攻击特效…

10.C++程序中的循环语句

C中提供了三种循环语句&#xff08;for循环&#xff0c;while循环以及do-while循环)来使程序员可以更方便地对数据进行迭代操作。 if语句 for语句的格式为&#xff1a; for(初始化语句&#xff1b;循环条件&#xff1b;迭代语句&#xff09; &#xff5b; 代码块 &#x…

网上找旅游搭子靠谱吗?分享国庆与旅行搭子出行的冒险记

国庆将至&#xff0c;我那颗渴望旅行的心愈发躁动不安。一直想在这个难得的假期里去领略祖国的大好河山&#xff0c;思来想去&#xff0c;决定去神秘而美丽的张家界。然而&#xff0c;身边的朋友不是已有安排&#xff0c;就是对这个目的地不感兴趣。无奈之下&#xff0c;我只好…

ArcGIS与ArcGIS Pro去除在线地图服务名单

我们之前给大家分享了很多在线地图集&#xff0c;有些地图集会带有制作者信息&#xff0c;在布局制图的时候会带上信息影响出图美观。 一套GIS图源集搞定&#xff01;清新规划底图、影像图、境界、海洋、地形阴影图、导航图 比如ArcGIS&#xff1a; 比如ArcGIS Pro&#xff1a…

书生大模型实战(从入门到进阶)L2-茴香豆:企业级知识库问答工具

目录 茴香豆介绍 茴香豆本地标准版搭建 环境搭建 配置服务器&#xff1a; 搭建茴香豆虚拟环境&#xff1a; 安装茴香豆 下载茴香豆 安装茴香豆所需依赖 下载模型文件 更改配置文件 知识库创建 测试知识助手 命令行运行 Gradio UI 界面测试 本文是对书生大模型L2-茴香…

电脑录屏怎么录视频和声音?苹果macOS、windows10都可以用的原神录屏工具来啦

在当今数字化时代&#xff0c;电脑录屏已经成为一项非常实用的技能&#xff0c;无论是制作教学视频、记录游戏精彩瞬间&#xff0c;还是进行线上会议演示&#xff0c;都离不开高质量的录屏。那么&#xff0c;电脑录屏怎么录视频和声音呢&#xff1f;今天就为大家详细介绍一下&a…

<<迷雾>> 第 2 章 用电来表示数 示例电路

开关的通断对应着1和0 info::操作说明 鼠标单击开关切换开合状态 primary::在线交互操作链接 https://cc.xiaogd.net/?startCircuitLinkhttps://book.xiaogd.net/cyjsjdmw-examples/assets/circuit/cyjsjdmw-ch02-01-represent-number-by-switch.txt 原图 通过使用多个开关、可…