02 2013 档案

摘要:判断缓存是否存在 if (HttpRuntime.Cache[key] == null) { }插入缓存 缓存过期时间为2个小时NoAbsoluteExpiration:相对过期时间,生成缓存后若在没有过期的时间段被取,则过期时间后推10分钟,例如:11:1分钟时生成的 在11:5分钟时被取了,则过期时间为11:15分钟HttpRuntime.Cache.Insert(key.ToUpper(), dic, null,System.Web.Caching.Cache.NoAbsoluteExpiration,TimeSpan.FromMinutes(10));NoSlidingExpirat. 阅读全文
posted @ 2013-02-19 18:34 ajunfly 阅读(223) 评论(0) 推荐(0)
摘要:/// <summary> /// dataTable转换成Json格式 /// </summary> /// <param name="dt"></param> /// <returns></returns> public static string ToJson(DataTable dt) { if (dt != null && dt.Rows.Count > 0) { StringBuilder jsonBuilder = new StringBuilder(); jsonB 阅读全文
posted @ 2013-02-17 09:41 ajunfly 阅读(2111) 评论(0) 推荐(0)
摘要:static string str = "|add|and|exec|insert|select|delete|update|chr|mid|master|or|truncate|char|declare|join|"; public static bool DataVerify() { string type = HttpContext.Current.Request.RequestType.ToLower(); bool flag = true; if (type == "post") { for (int i = 0; i < HttpCon 阅读全文
posted @ 2013-02-16 17:58 ajunfly 阅读(344) 评论(0) 推荐(0)
摘要:public static object Invokewebservice(string url, string @namespace, string classname, string methodname, object[] args) { try { WebClient wc = new WebClient(); Stream stream = wc.OpenRead(url + "?wsdl"); ServiceDescription sd = ServiceDescription.Read(stream); ServiceDescriptionImporter s 阅读全文
posted @ 2013-02-05 18:13 ajunfly 阅读(241) 评论(0) 推荐(0)