Are you looking for some specific API, or a general algorithm? I don't know the .NET API, but I'd guess there's a bignum class that could be instantiated with a specific radix, and then converted to a ...
Log out of Google and search for [binary], [octal] and [hexadecimal] and you will see a little geeky easter egg. The easter egg shows the value of the results in that number systems. For example, here ...