Adding string binary numbers
For now, let's ignore the fact that there are easier ways to add binary numbers. There are other issues with this code. 




Inherits System.Web.UI.Page



Why is code that adds binary numbers inheriting from a UI class? There's no need for this. Separate the concerns and create a module for this code instead. 



carry is scoped to the class level. This is a symptom of problems in this code. 


Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
    Dim binary1 As String = TextBox1.Text 'First binary number
    Dim binary2 As String = TextBox2.Text 'Second binary number
    Dim result As String = "" 'to store the result
    For i As Integer = Len(binary1 ) - 1 To 0 Step -1
        result = bin_add(getbyte(binary1 , i), getbyte(binary1, i)) &amp; result ' calling function
    Next
    If carry = True Then
        result = "1" &amp; result 'if a carry remains add it to the MSB
    End If
    MsgBox(rslt) 'Display the result
End Sub



Getting the values from the UI makes sense, but then you loop over bin_add, which obviously doesn't actually add anything, or you wouldn't need to loop or have a class variable. All of this logic should happen inside of bin_add.

bin_add should take in two strings, handle all of the logic, and return a single string representing the output. While I'm at it, methods should have PascalCased verb-noun names. This method should be called AddBinary and I will refer to it as such for the rest of the review.  

As I said earlier, I wouldn't expect a Function that adds binary numbers to take in Boolean values. I would rather it actually take in a byte and overload the method to handle string representation, but I'm lazy and you don't seem to need all that.

Putting it all together, the signature line 


Public Function bin_add(b1 As Boolean, b2 As Boolean) As String



Should look like this. 

Public Function AddBinary(value1 as String, value2 as String) As String


Implementing this change will be left as an exercise for the reader.