C#最简单的字符串加密解密方法
更新时间:2015年05月08日 09:48:36 投稿:junjie
这篇文章主要介绍了C#最简单的字符串加密解密方法,本文直接给出实例代码,需要的朋友可以参考下
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;
}
相关文章
Unity3D获取当前键盘按键及Unity3D鼠标、键盘的基本操作
这篇文章主要介绍了Unity3D获取当前键盘按键及Unity3D鼠标、键盘的基本操作的相关资料,需要的朋友可以参考下2015-11-11


最新评论