2015-05-08 79 views
0

如何解決從十進制轉換爲二進制的以下問題?十進制轉換爲二進制轉換錯誤

void tobinary(int bin) { 
    string binary = Convert.ToInt32(bin, 2); 
} 

這些都是錯誤:

錯誤2:參數2:最好:無法從 'INT' 到 'System.IFormatProvider' 42

錯誤1轉換'System.Convert.ToInt32(object,System.IFormatProvider)'的重載方法匹配有一些無效參數42

回答