摘要: start-time(选填)任务开始执行时间utc时间,北京时间需要+08:00,如:2012-04-01T08:00:00+08:00表示北京时间2012年4月1日上午8:00开始执行,注意服务启动或重启时都会检测此属性,若没有... 阅读全文
posted @ 2014-04-30 11:48 sherlock99 阅读(290) 评论(0) 推荐(0) 编辑
摘要: public static void SetTValue(T model, DataTable dt) { if (dt.Rows.Count == 0) { return; ... 阅读全文
posted @ 2014-04-22 14:59 sherlock99 阅读(427) 评论(0) 推荐(0) 编辑
摘要: 在config.yaml中配置如下配置段:name: cronversion: 1cron:- description: send_weibo_task url: /task/ schedule: every day of month 8:00注意那个 /task/假设你要定时调用的地址是 ht... 阅读全文
posted @ 2014-04-21 22:38 sherlock99 阅读(261) 评论(0) 推荐(0) 编辑
摘要: ASP.NET MVC中使用AJAX传参技巧1.客户端使用Querystring传参 一般情况下进行GET请求才会这么做,类似在浏览器的地址栏敲进去的url地址那样,客户端的js代码如下,这里对服务器端做了一个请求(这里用GET),请求通过url上的Querystring传了五个参数: 下面是服... 阅读全文
posted @ 2014-04-17 20:07 sherlock99 阅读(1313) 评论(0) 推荐(0) 编辑
摘要: string UAC = GetRegKey("127.0.0.1", @"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "LocalAccountTokenFilterPolicy");private static stri... 阅读全文
posted @ 2014-04-17 20:00 sherlock99 阅读(413) 评论(2) 推荐(0) 编辑
摘要: 原本想用cmd模拟执行telnet命令去检测80端口是否开放,从而检测服务器上是否安装了IIS,无奈telnet命令不会重定向input和output,无法用程序去执行。故想到使用tcp连接去连80端口,以此来检查80端口开放。TcpClient tcpClient = new TcpClient(... 阅读全文
posted @ 2014-04-17 16:35 sherlock99 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 异常信息如下:使用JSONJavaScriptSerializer进行序列化或反序列化时出错。字符串的长度超过了为maxJsonLength属性设置的值。这个异常是在执行MVC中的JsonResult的时抛出的,根据异常的Message得知是序列化的字符串超出了maxJsonLength的限制。并得... 阅读全文
posted @ 2014-04-11 23:19 sherlock99 阅读(1993) 评论(2) 推荐(0) 编辑
摘要: 1 public bool SaveCompareResult(List c) 2 { 3 bool flag = false; 4 using (var db = new AOPContext()) 5 { ... 阅读全文
posted @ 2014-04-11 14:29 sherlock99 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 路径超过260字符,不能采用普通的Copy等函数了。使用如下的代码:/// /// 长文件名的文件拷贝/// /// /// /// [DllImport("kernel32.dll", CharSet = CharSet.Unicode)][return: MarshalAs(UnmanagedType.Bool)]internal static extern bool CopyFile(string source, string target, bool overwrite);public static void Copy(string source, string t 阅读全文
posted @ 2014-03-31 15:38 sherlock99 阅读(988) 评论(0) 推荐(0) 编辑
摘要: 学习资料http://msdn.microsoft.com/zh-cn/library/vstudio/dd537608(v=vs.100).aspx数据并行是指对源集合或数组中的元素同时(即并行)执行相同操作的情况。简单的并行for循环 Parallel.For(0, length, i =>{ //do something about i});并行foreach循环 // Method signature: Parallel.ForEach(IEnumerable source, Action body) Parallel.ForE... 阅读全文
posted @ 2014-01-13 16:46 sherlock99 阅读(295) 评论(0) 推荐(0) 编辑