C#中如何重写下列办法加密
javascript中
function compile(code)
{
var c=String.fromCharCode(code.charCodeAt(0)+code.length);
for (var i=1;i<code.length;i++)
{
c+=String.fromCharCode(code.charCodeAt(i)+code.charCodeAt(i-1));
}
在c#中如何写阿
问题点数:0、回复次数:6Top
1 楼xiaohutushen(程序人生)回复于 2005-03-04 19:33:34 得分 0
upTop
2 楼yufenfeila(雨纷飞啦)回复于 2005-03-04 20:06:27 得分 0
试试看
string compile(string code)
{
byte[] bytes;
bytes = System.Text.Encoding.Default.GetBytes(code);
string c = (bytes[0] + bytes.Length).ToString();
for (int i = 1; i < bytes.Length; i++)
c += (bytes[i] + bytes[i - 1]).ToString();
return c;
}Top
3 楼AllenTing(今天你GC了吗???)回复于 2005-03-04 20:32:36 得分 0
gzTop
4 楼mobil1(lingd1)回复于 2005-03-04 20:38:07 得分 0
好像差一些
原来的js加密后为f%CD%D1%D7%E6
yufenfeila(雨纷飞啦)的加密后为102205209215230Top
5 楼mobil1(lingd1)回复于 2005-03-05 10:31:53 得分 0
那位大虾来帮忙阿Top
6 楼anis0444()回复于 2005-03-05 10:58:07 得分 0
类库里有专门加密的类Top




