打印

[NET精华教程] .net教程:给大家一个新的加密方法,c#的。(国外的,只用于学习,支持中文)

.net教程:给大家一个新的加密方法,c#的。(国外的,只用于学习,支持中文)

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;
        }
    }<



TOP

返回顶部
AYBlue

Processed in 0.040177 second(s), 7 queries.

当前时区 GMT+8, 现在时间是 2009-1-8 15:46 京ICP备06054220号

清除 Cookies - 联系我们 - 163K.com - Archiver - WAP