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;
}
相關文章
C#使用System.Environment獲取電腦的相關屬性
這篇文章主要為大家詳細介紹了C#使用System.Environment獲取電腦的相關屬性,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-10-10
C# 實現(xiàn)與現(xiàn)有.NET事件橋接簡單實例
這篇文章主要介紹了C# 實現(xiàn)與現(xiàn)有.NET事件橋接簡單實例的相關資料,需要的朋友可以參考下2017-03-03
C#實現(xiàn)在網(wǎng)頁中根據(jù)url截圖并輸出到網(wǎng)頁的方法
這篇文章主要介紹了C#實現(xiàn)在網(wǎng)頁中根據(jù)url截圖并輸出到網(wǎng)頁的方法,涉及C#網(wǎng)頁瀏覽器及圖片操作的相關技巧,需要的朋友可以參考下2016-01-01

