Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Visual Basic 2010: RFID Reader To Display One Line From Code

Options
  • 01-02-2012 4:22pm
    #1
    Registered Users Posts: 33


    Hi All,

    I am working on a code that can read and displays the rfid tag onto a textbox in Visual Basic 2010. What I am stuck on at the moment is that it displays all of the code from when a card is swiped over the rfid reader and I only want it to display one line which is the UID code line eg.Card UID: 0x88 04 BD 3F 49 BB 02 80. The rfid code that displays is as below:


    IC Type: Philips Mifare UltraLight
    Card UID: 0x88 04 BD 3F 49 BB 02 80
    ATQA Byte[1]: 0x00 ATQA Byte[0]: 0x44 SAK: 0x00

    Serial Number [Page 0]: 0x04 BD 3F 0E .??.
    Serial Number [Page 1]: 0x49 BB 02 80 I?.?
    Internal/Lock [Page 2]: 0x70 48 00 00 pH..
    OTP [Page 3]: 0x00 00 00 00 ....
    Data [Page 4]: 0xFF FF FF FF ????

    Data [Page 5]: 0x00 00 00 00 ....
    Data [Page 6]: 0x00 00 00 00 ....
    Data [Page 7]: 0x00 00 00 00 ....
    Data [Page 8]: 0x00 00 00 00 ....
    Data [Page 9]: 0x00 00 00 00 ....
    Data [Page 10]: 0x00 00 00 00 ....
    Data [Page 11]: 0x00 00 00 00 ....
    Data [Page 12]: 0x00 00 00 00 ....
    Data [Page 13]: 0x00 00 00 00 ....
    Data [Page 14]: 0x00 00 00 00 ....
    Data [Page 15]: 0x00 00 00 00 ....



    As you can see I only want visual basic to display the UID line only. Anyone have an idea on how I can do that please? The part of the code I have for when displaying the rfid code is:

    Private Sub SetText(ByVal [text] As String)
    If Me.TextBox4.InvokeRequired Then
    Dim d As New SetTextCallback(AddressOf SetText)
    Me.Invoke(d, New Object() {[text]})
    Else
    Me.TextBox4.Text = Me.TextBox4.Text & [text] & vbCrLf
    End If



    Any help would be appreciated. Thanks.

    Ciara


Comments

  • Registered Users Posts: 683 ✭✭✭JazzyJ


    Use regular expressions - they're essential to know: http://www.regular-expressions.info/dotnet.html (that's a really good site for reference too)

    Or if its always going to be on the second line, off the top of my head something like (in C#): text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)[1] might work.

    J.


Advertisement