I need help finding the 32-bit binary representation of an integer in C#. In Perl, I'm using unpack("B32", pack("N", $arg))
.
Thanks in advance.
I need help finding the 32-bit binary representation of an integer in C#. In Perl, I'm using unpack("B32", pack("N", $arg))
.
Thanks in advance.
このようなもの:
int x = some_value;
var networkOrder = IPAddress.HostToNetworkOrder(x);
var result = Convert.ToString(networkOrder, 2).PadLeft(32, '0');
詳細については、同様の質問を参照してください。