问题自己已经解决了!!!! private int LetterToNumber(string str) { int i; int Result = 0; str = str.ToUpper(); for (i = 0; i < str.Length; i++) Result = Result + ((int)(str[i]) - (int)('A') + 1) * (int)(Math.Pow(26, str.Length - i - 1)); return Result; } 贴出代码 大家看吧!!!!
private int LetterToNumber(string str)
{
int i;
int Result = 0;
str = str.ToUpper(); for (i = 0; i < str.Length; i++)
Result = Result + ((int)(str[i]) - (int)('A') + 1) * (int)(Math.Pow(26, str.Length - i - 1));
return Result;
}
贴出代码 大家看吧!!!!