文章分类 -  通用

.net全站过滤url危险参数,防注
摘要:在global文件 void Application_BeginRequest(object sender, EventArgs e)中添加如下代码: void Application_BeginRequest(object sender, EventArgs e) { //遍历Post参数,隐藏域除外 if (Regex.IsMatch(Request.RawUrl.ToLower(), @"/manager/")==false) for (int i=0; i < Request.Form.Count;i++) { if (Request.Form[i].ToSt 阅读全文

posted @ 2011-03-11 15:33 MyBeN 阅读(1409) 评论(0) 推荐(0)

一个通用的加密、解密类
摘要:public class Encrypt{ /// <summary> /// 加密 /// </summary> /// <param name="str">待加密的明文字符串</param> /// <param name="key">密钥</param> /// <returns>加密后的字符串</returns> public static string EncryptString(string str, string key) { byte[] bS 阅读全文

posted @ 2011-03-11 15:32 MyBeN 阅读(240) 评论(0) 推荐(0)

LogHelper 的摘要说明(写入日志)
摘要:public static class LogHelper{ public static string path = string.Empty; public static void WriteLog(Exception ex,HttpRequest Request) { Exception objErr = ex; string error = string.Empty; string errortime = string.Empty; string erroraddr = string.Empty; string errorinfo = string.Empty; string error 阅读全文

posted @ 2011-03-11 15:30 MyBeN 阅读(684) 评论(0) 推荐(0)

导航