当前位置:首页 » 服务器技术
开发技术指南» 文章正文
    引言: //声明加密字符生成的随机数的位数public const in
 

 

 ·试用sharpdevelop之感想    »显示摘要«
    摘要:详细请看:试用sharpdevelop之感想 ......
 ·essential .net 学习笔记[1] clr    »显示摘要«
    摘要:买了.net本质论有一个多月了,零零碎碎的看到了第五章,竟然突然发现连最基本的几个概念都还没搞清楚,看来笔记还是要记得了 :)-------------------------------------------------------------------------- 1. cts (common type system, 通用类型系统) : 语言无关的(language-neutral)类型系统,用于cli原数据和指令.2. cls (commo......


发一个加密的方法

//声明加密字符生成的随机数的位数

  public const int length = 32; 【相关文章:这是2003年公司进行过程改进时的一篇讨

【扩展阅读:JSP环境准备

  //声明加密字符前后的分隔长度 【扩展信息:这是2003年的另一篇讨论稿

  public const int len = 4;

///方法作用:根据参数对其加密

  ///参数:

  ///  string strencrypt;欲加密的字符

  ///返回结果:加密后的字符

  public static byte[] sourceencrypt(string strencrypt)

  {

   string source = encrypt(strencrypt);

   //first

   string first = encrypt(source.substring(0,len));

   //second

   string second = encrypt(source.substring(len-1,source.length-len));

   //third

   string third = encrypt(source.substring(source.length-len,len));

   //four

   byte[] random = new byte[length];

   rngcryptoserviceprovider rng = new rngcryptoserviceprovider();

   rng.getnonzerobytes(random);

   string four = encrypt(system.text.encoding.ascii.getstring(random));

   string all = first+second+third+four;

   return system.text.encoding.ascii.getbytes(all);

  } // end sourceencrypt


...   下一页
 ·使用cookie传递数据    »显示摘要«
    摘要:首先添加using system.web.sessionstate引用。 这样发送信息: httpcookie cookie = new httpcookie("usercookie"); cookie.values.add("username",tbname.text); cookie.values.add("userpassword",tbpassword.value.tostring(......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE