C#加密,高手进

来源:百度知道 编辑:UC知道 时间:2024/06/24 18:51:35
对字符串进行加密,加密后的字符串的第一个字符时原字符串的最后一个字符,其余的每个字符是对应的原字符串中的前一个字符的值加上三,比如“welcome”末尾字符为“e”,“welcome”依次加上三后成为“zhofrp” 程序由用户任意输入字符串,加密后输出。
那位大侠知道,告诉我。写写了~

using System;
using System.Collections.Generic;
using System.Text;

namespace Test
{
class Program
{
static void Main(string[] args)
{
string[] abc = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y","z" };
Console.WriteLine("请输入字符串:");
string str = Console.ReadLine();
str = str.Substring(0, str.Length - 1);
StringBuilder sb = new StringBuilder(str.Length - 1);
foreach (char s in str)
{
for (int i = 0; i < 26; i++)