自己写的,可以进行数制转换 private static int ConvertString(string value, int fromBase, int toBase) { int intValue = Convert.ToInt32(value, fromBase); string Value = Convert.ToString(intValue, toBase); return Convert.ToInt32(Value); }
很简单了int i = 17; string hexI = Convert.ToString(i,16);
Convert.ToInt32
我这没vs,记不太清了!
private static int ConvertString(string value, int fromBase, int toBase)
{
int intValue = Convert.ToInt32(value, fromBase);
string Value = Convert.ToString(intValue, toBase);
return Convert.ToInt32(Value);
}
string hexI = Convert.ToString(i,16);
加深一下记忆!