C#最简单的字符串加密解密方法

内容摘要
public static string encode(string str)
{
string htext = "";

for (int i = 0; i < str.Length; i++)
{
htext = htext + (char)(str
文章正文
public static string encode(string str)
    {
      string htext = "";
 
      for (int i = 0; i < str.Length; i++)
      {
        htext = htext + (char)(str[i] + 10 - 1 * 2);
      }
      return htext;
    }
 
    public static string decode(string str)
    {
      string dtext = "";
 
      for (int i = 0; i < str.Length; i++)
      {
        dtext = dtext + (char)(str[i] - 10 + 1 * 2);
      }
      return dtext;
    }


代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!