Solved

how to add 2 byte array

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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