代码改变世界

36进制进位算法例子

2008-06-20 11:21  Vincent.C  阅读(414)  评论(0编辑  收藏  举报

36进制进位算法例子.

string s_runcard = ds.Tables[0].Rows[0][0].ToString();                 char[] t_arychr = new char[s_runcard.Length];                 t_arychr = s_runcard.ToCharArray();                 int i_row = (int)t_arychr[s_runcard.Length - 2];                 int i_col = (int)t_arychr[s_runcard.Length - 1];                 i_col++;                 if (i_col >= 91)                 {                     i_col = 48;                     i_row++;                     if (i_row >= 91)                     {                         tb_runcard.Text = "wrong";                     }                     else                     {                         if (i_row >= 58 && i_row <= 64)                         {                             i_row = 65;                         }                     }                 }                 else                 {                     if (i_col >= 58 && i_col <= 64)                     {                         i_col = 65;                     }                 }

                tb_subruncard.Text = s_runcard.Substring(0, s_runcard.Length - 2) + ((char)(byte)i_row).ToString() + ((char)(byte)i_col).ToString();