摘要: SqlCommand cmd=con.CreateCommand();cmd.CommandText="exec('select * from novel where novelid in ('+@s+')')";cmd.Parameters.Add("@s","'13030,12581'"); 阅读全文
posted @ 2013-09-29 09:52 DCLancer 阅读(831) 评论(0) 推荐(0) 编辑
摘要: 天往MVC中加入了一个富文本编辑框,在提交信息的时候报了如下的错误:从客户端(Content="这是测试这...")中检测到有潜在危险的Request.Form值。说明:请求验证过程检测到有潜在危险的客户端输入值,对请求的处理已经中止。该值可能指示存在危及应用程序安全的尝试,如跨站点脚本攻击。若要允许页面重写应用程序请求验证设置,请将httpRuntime配置节中的requestValidationMode特性设置为requestValidationMode="2.0"。示例:。设置此值后,可通过在Page指令或配置节中设置validateRequest 阅读全文
posted @ 2013-09-10 19:58 DCLancer 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 添加对ICSharpCode.SharpZipLib的引用。using ICSharpCode.SharpZipLib.BZip2;/// /// 压缩 /// /// /// private static string Compress(string text) { if (text.IsNullOrEmpty()) { return string.Empty; } using (Me... 阅读全文
posted @ 2013-08-02 11:42 DCLancer 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 直接上方法public string ConvertToMd5(string password) { if (string.IsNullOrEmpty(password)) { return string.Empty; } using (MD5CryptoServiceProvider MD5 = new MD5CryptoServiceProvider()) { return BitConverter.ToSt... 阅读全文
posted @ 2013-06-04 16:59 DCLancer 阅读(144) 评论(0) 推荐(0) 编辑
摘要: <file type="log4net.Util.PatternString" value="Logs/%property{name}-log.txt" />然后再在log4net初始化之前加上C#代码log4net.GlobalContext.Properties["name"] = this.GetType().Name;就会为相应的类生成相应类名的文件 如HomeController-log.txt 阅读全文
posted @ 2013-05-31 14:33 DCLancer 阅读(576) 评论(0) 推荐(0) 编辑
摘要: 在配置文件的configuration节点下加入如下配置<system.net> <mailSettings> <smtp deliveryMethod="Network" from="dongchao5525@126.com" > <network host="smtp.126.com" userName="dongchao5525" password="XXXXXX"/> </smtp> </mailSettings> 阅读全文
posted @ 2013-05-07 09:56 DCLancer 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 使用RollingFileAppender以日期为日志文件名,网上提供最多的做法就是:<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender,log4net"> <file value="Logs/" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <dat 阅读全文
posted @ 2013-05-06 10:36 DCLancer 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 修改系统时间,TFS会无法登陆 阅读全文
posted @ 2013-04-26 17:04 DCLancer 阅读(169) 评论(0) 推荐(0) 编辑
摘要: The web.config file exists in the Views folders to prevent access to your views by any means other than your controller. In the MVC design pattern, controllers are supposed to route requests and return a rendered view to the calling client.In other words, your view at www.mydomain.com/MySuperControl 阅读全文
posted @ 2013-04-25 11:32 DCLancer 阅读(766) 评论(0) 推荐(0) 编辑
摘要: 1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName 获取模块的完整路径。2. System.Environment.CurrentDirectory 获取和设置当前目录(该进程从中启动的目录)的完全限定目录。3. System.IO.Directory.GetCurrentDirectory() 获取应用程序的当前工作目录。这个不一定是程序从中启动的目录啊,有可能程序放在C:\www里,这个函数有可能返回C:\Documents and Settings\ZYB\,或者C:\Program Files\Ad 阅读全文
posted @ 2013-04-24 17:36 DCLancer 阅读(149) 评论(0) 推荐(0) 编辑
(function() { var c = document.createElement('script'); c.type = 'text/javascript'; c.async = true; c.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'www.clicki.cn/boot/48212'; var h = document.getElementsByTagName('script')[0]; h.parentNode.insertBefore(c, h); })();