易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP.NET中字符串进行MD5加密

最近在看《asp.net通用模块及典型系统开发实例导航》,其中用到了MD5加密,代码如下: /// <summary>
/// 字符串加密函数
/// </summary>
/// <param name="strInput">输入被加密的字符串</param>
/// <returns>加密后的字符串</returns>
public static string Encrypt(string strInput)
{
//转换为UTF8编码
byte[] b = System.Text.Encoding.UTF8.GetBytes(strInput);
//计算字符串UTF8编码后的MD5哈希值,并转换为字符串
MD5 md5 = new MD5CryptoServiceProvider();
return System.Text.Encoding.UTF8.GetString(md5.ComputeHash(b));
}

在IE下测试了,在数据库里看到的确实是加密之后的字符串。
现在考虑的问题是,该如何实现解密?


相关文档:

让ASP.Net HTML页面代码 清爽起来

自从用了 ASP.Net MVC后就喜欢上了它 ,因为MVC对服务器控件的依赖大大减少,它生成的HTML页面就比WebForm清爽多了,加载速度有了明显的改善。
但对于页面中内嵌script,还是不能彻底的避免,如:
<script type="text/javascript" language="javascript">
//<!--
function DepositPa ......

Mix 10 上的asp.net mvc 2的相关Session

Beyond File | New Company: from Cheesy Sample to Social Platform Scott Hanselman in Lagoon L on Monday at 11:30 AM The web has changed and there's a new way of thinking about your applications. You can't just write some HTML and CSS anymore and expect to be the next Twitter. Hear h ......

在 vs2008为asp.net ajax添加js智能感知


vs2008为asp.net ajax添加js智能感知



今天找了好久,终于搞清楚了,scriptManager控件支持js智能感知,而从其继承的toolkitScriptManager不支持。至少在
vs2008b2中是这样。
要在js文件中添加asp.net ajax的js智能感知(与scriptManager控件无关),在js文件的开头添加这样一行即可:
//
/<referen ......

asp.net准确截取文本长度(取得标题的字符数)

asp.net中自带的CutString只能截取字符数量的长度,但中英文字符数有差异,一个中文字等同于二个英文字符的宽度,这样对截取后的效果不理想.使用以下的方法就能解决.
//调用方法
string title=BLL.CutStr.CutString("标题",10);using System;
using System.Collections.Generic;
using System.Text;
namespace BLL
{
&n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号