I have a VB.Net application that goes through a series of processes to decode a string, one problem with this is that I have found a function that converts from binary to decimal for any number, but I cannot find a function that will convert a supplied number (in string format) into a binary string. For reference, the binary to decimal conversion function is below:

```
Public Function baseconv(d As String)
    Dim N As Long
    Dim Res As Long
    For N = Len(d) To 1 Step -1
        Res = Res + ((2 ^ (Len(d) - N)) * CLng(Mid(d, N, 1)))
    Next N
    Return Str(Res)
End Function

```