1. 程式人生 > >C# 幾進位制 轉換到幾進位制

C# 幾進位制 轉換到幾進位制

public string ConvertString(string value, int fromBase, int toBase) 



int intValue = Convert.ToInt32(value, fromBase); 

return Convert.ToString(intValue, toBase); 


其中fromBase為原來的格式 

toBase為將要轉換成的格式