string toRadix(double N, int radix)
       {
           string HexN = "";
           double Q = Math.Floor(Math.Abs(N)), R;
           string s = "0123456789abcdefghijklmnopqrstuvwxyz";
           while (true)
           {
               R = Q % radix;

               HexN = s[(int)R] + HexN;
               Q = (Q - R) / radix;
               if (Q == 0) break;
           }
           return ((N < 0) ? "-" + HexN : HexN);
       }
var s = ((long)TimeSpan.FromTicks(DateTime.Now.AddDays(30).Ticks - new DateTime(1970, 01, 01).Ticks).TotalMilliseconds) + (3000 * 1000);
toRadix(s, 36)
posted on 2011-10-11 09:31  rolends1986  阅读(276)  评论(0编辑  收藏  举报