参考
http://community.csdn.net/Expert/topic/5580/5580971.xml?temp=.1863825

解决方案 »

  1.   

    还是贴出来吧,输入ZZZ呢,000吗?private bool GetChar(ref char c)
    {
        if (c=='Z')
        {
            c = '0';
            return true;
        }
        else if(c=='9')
        {
            c = 'A';
            return false;
        }
        else
        {
            c++;
            return false;
        }
    }
    public string GetNewCode(string strOldCode)
    {
        if (strOldCode=="ZZZ") return "000";
        char[] arr = strOldCode.ToCharArray();
        if (GetChar(ref arr[2]))
        {
            if (GetChar(ref arr[1]))
            {
                GetChar(ref arr[0]);
            }
        }
        return new string(arr);
    }