Solved

how to add 2 byte array

Posted on 2006-11-02
3
567 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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 …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

929 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

10 Experts available now in Live!

Get 1:1 Help Now