md5加密的问题!

来源:百度知道 编辑:UC知道 时间:2024/05/25 02:13:30
string strMd5=System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password2, "md5");

Response.Write(strMd5);

为什么还要加上Response.Write(strMd5),调用嘻哈函数没有直接写进strMd5中吗?
哦,那我怎么在调试运行的时候,在strMd5=System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password2, "md5"); 这句插入断点,为什么取不到strMd5的值?在Response.Write(strMd5);这句才能取到?

Response.Write(strMd5); 这句的作用是在页面上输出你得到的 md5码。

你在strMd5=System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile

这一句设置断点当然取不到值了,因为在这一句设断点, 这一句还没有被执行。

你在Response.Write(strMd5); 设断点,此时,上一句才执行,所以才取到值。

Response.Write(strMd5),

这一句的作用就是把strMd5的内容输出到网页上,和加密没有关系

当设置到断点到这句的时候,这句都是没有完成赋值的,一定要到下一句,strMd5才会完成赋值
strMd5=System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile

不用写Response.Write(strMd5)已经直接写进去了 你写Response.Write(strMd5)的目的是打印出strMd5 不写之会不显示而已 !!你不写也是一样的