菜神提问
using System;
public interface IBindesh
{
string encode(string str);
string decode(string str);
}
namespace EncryptionDecryption
{
/// <summary>
/// 加密解密
/// </summary>
public class EncryptionDecryption : IBindesh
{
public 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 string decode(string str)
{
string dtext = " ";
for ( int i=0; i < str.Length; i++)
{
dtext = dtext + (char) (str[i] - 10 + 1*2);
}
return dtext;
}
}
public class test
{
public static void aa()
{
EncryptionDecryption inter = new EncryptionDecryption();
Console.WriteLine(((IBindesh)inter).encode( "aa "));
System.Console.ReadLine();
}
}
}
哪位高手能详细解释上面的这段代码?