首页 公务员 公选 公考 司考 会计 报关员 考研 自考 演讲 写作 科技 网络 娱乐 管理 好友 小组
给大家一个新的加密方法,C#的
日期:5月31日 17时  来源:网摘  佚名  阅读:点击...
【字体: 【页面调色版 
  

  


using System;

/* The reason that i am using interface is that, in several
* weeks i will use a bitwise operator for have encryption and decryption
* */
public interface IBindesh
{
    string encode(string str);
    string decode(string str);
}

namespace EncryptionDecryption
{
    /// <summary>
    /// Summary description for EncryptionDecryption.
    /// </summary>
    public class EncryptionDecryption : IBindesh
    {
        public string encode(string str)
        {
            string htext = ""; // blank text

            for ( int i = 0; i < str.Length; i++)
            {
                htext = htext + (char) (str + 10 - 1 * 2);
            }
            return htext;
        }

        public string decode(string str)
        {
            string dtext = "";

            for ( int i=0; i < str.Length; i++)
            {
                dtext = dtext + (char) (str - 10 + 1*2);
            }
            return dtext;
        }
    }
}
精彩图片
相关文章
最新更新
热评文章
公务员专题
党政专题 电信行业 公检法院 医疗卫生
工商税务 新闻信息 农林畜牧 计生服务
教育科技 金融保险 企业资源 机械化工
电力交通 行风评议 保先教育 讲话报告
公共机关 农村工作 秘书研究 建筑设计
八荣八耻 新 农 村