12 2012 档案

摘要:Web.config中设置CustomErrorCustomError定义自动处理异常的行为,如下所示:<system.web><!--<customErrors mode="RemoteOnly" defaultRedirect="~/error.html"/>--><customErrors mode="On" defaultRedirect="~/error.html"/><!--<customErrors mode="Off" 阅读全文
posted @ 2012-12-27 17:23 草青工作室 阅读(704) 评论(0) 推荐(0)
摘要:以下代码为 asp.net mvc 4.0 代码做的 301 永久重定向 string url = “http://www.csdn.net/test.html” Response.StatusCode = 301; Response.Status = "301 Moved Permanently"; Response.AppendHeader("Location", url)); Response.AppendHeader("Cache-Control", "no-cache"); //这里很重要的一个设置,no 阅读全文
posted @ 2012-12-25 20:05 草青工作室 阅读(1052) 评论(0) 推荐(0)
摘要:使用 .net 自带的方法 TrimEnd(char[]) 也可以删除,但是有些情况不是我们想要的结果如:source =bx20x0x0x0;delStr = x0;source =source.TrimEnd("x0".ToArry());这时 source 的值为:bx2;其实我们的预期是,想得到bx20 值。上面多删除了一个 0。解决方案:重写一个 TrimEnd 扩展 /// <summary> /// 在字符串尾部删除重复的指定字符串 /// </summary> /// <returns></returns> p 阅读全文
posted @ 2012-12-12 20:10 草青工作室 阅读(194) 评论(0) 推荐(0)
摘要:一、文件位置如下C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\WcfTestClient.exe二、使用方法添加服务调用 阅读全文
posted @ 2012-12-04 17:35 草青工作室 阅读(233) 评论(0) 推荐(0)