net 为我们提供了丰富的转化方法,很简单
public string ConvertString(string value, int fromBase, int toBase)
{
int intValue = Convert.ToInt32(value, fromBase);
return Convert.ToString(intValue, toBase);
}
fromBase, 要转化的进制
toBase, 要转化为的进制
For Example: this.textBox1.Text = ConvertString("D0E7B0", 16, 10);
发表于 @ 2007年01月25日 13:54:00|评论(loading...)|编辑