From - Binary to Integer
Private Function ToInteger(ByVal x As Long) As String
Dim temp As String
Dim ch As Char
Dim multiply As Integer = 1
Dim subtract As Integer = 1
Dim len As Integer = CStr(x).Length
For Each ch In CStr(x)
For len = 1 To CStr(x).Length - subtract
multiply = multiply * 2
Next
multiply = CInt(ch.ToString) * multiply
temp = multiply + temp
subtract = subtract + 1
multiply = 1
Next
Return temp
End Function
From - Integer to Binary
Private Function ToBinary(ByVal x As Long) As String
Dim temp As String = ""
Do
If x Mod 2 Then
temp = "1" + temp
Else
temp = "0" + temp
End If
x = x \ 2
If x < 1 Then Exit Do
Loop
Return temp
End Function
You can add this function to your application and call it with passing the respective parameter.