Is there a way to convert Int64 to 开发者_StackOverflowbinary and back to Int64?
var bytes = BitConverter.GetBytes(long);
var value = BitConverter.ToInt64(bytes, 0);
if string formatting is what you need:
Convert.ToString(someInt64, 2);
Convert.ToUInt64("101010", 2);
Similar to HuBeZa's answer, this converts type long
to string:
Convert.ToString(Convert.ToInt64(myLongInt), 2);
精彩评论