字符加密变换

            string Greeting="Hello World";
   Console.WriteLine(Greeting);
   for (int i=(int)'z';i>=(int)'a';i--)
   {
    char Old=(char)i;
                char New=(char)(i+1);
    Greeting=Greeting.Replace(Old,New);
   }
   for (char i='Z';i>='A';i--)
   {
    char Old=(char)i;
    char New=(char)(i+1);
    Greeting=Greeting.Replace(Old,New);
   }
   Console.WriteLine(Greeting);
   //TransLate content
            for (char i='b';i<'{';i++)
   {
    char Old=(char)i;
    char New=(char)(i-1);
    Greeting=Greeting.Replace(Old,New);
   }
   for (char i='B';i<'[';i++)
   {
    char Old=(char)i;
    char New=(char)(i-1);
    Greeting=Greeting.Replace(Old,New);
   }
   Console.WriteLine(Greeting);
  }
posted @ 2005-01-04 09:03  jhtchina  阅读(830)  评论(0编辑  收藏  举报