2010-12-02 342 views

回答

5

嘗試此

string binValue = Convert.ToString(myInt, 2); 

int intValue = Convert.ToInt32(myBinary, 2); 

實施例:

string binValue = Convert.ToString(16, 2); // = 10000 

int intValue = Convert.ToInt32("11010", 2); // = 26