I you ever would have the need to do this conversion you probably would usestring myStr = Convert.ToString(myInt,2);
which does the job.
Here is presented another way to do this with some simple formatting included.
Some highlights for newbies and not so newbies:
Line 9: Custom enum type
Line 37: const calculation
Line 42: Reversed for loop from up to down (to avoid having to reverse the array of bits afterwards)
Line 45: Use of left shift operator
Line 48: Use of ternary operator as a parameter to a method
Line 68: Use of LINQ (explained in the code) I like LINQ!
Line 70: String Join method
Hope you like it. As always, awaiting your comments and remarks!
Enjoy!