Solved

how to add 2 byte array

Posted on 2006-11-02
3
564 Views
Last Modified: 2008-03-06
how to add 2 byte array. ie
            Dim b1() As System.Byte = {48, 48, 50, 49, 48, 49, 49, 48, 242, 56, 0, 1, 14, 192, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0}
            Dim b2() As System.Byte = Encoding.ASCII.GetBytes("02300110")
0
Comment
Question by:ANKHAA
3 Comments
 
LVL 10

Accepted Solution

by:
gangwisch earned 50 total points
ID: 17858661
       Dim b3() As System.Byte
        Dim b1() As System.Byte = {48, 48, 50, 49, 48, 49, 49, 48, 242, 56, 0, 1, 14, 192, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0}
        Dim b2() As System.Byte = System.Text.Encoding.ASCII.GetBytes("02300110")
        If b1.Length > b2.Length Then
            For i As Integer = 0 To b1.Length - 1
                If b2.Length <= b1.Length Then
                    b3(i) = b1(i) + b2(i)
                Else
                    b3(i) = b1(i)
                End If
            Next
        Else
            'b2>=b1.length
            For i As Integer = 0 To b2.Length - 1
                If b1.Length <= b2.Length Then
                    b3(i) = b1(i) + b2(i)
                Else
                    b3(i) = b2(i)
                End If
            Next
        End If

b3 will contain your answer
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now