随笔分类 -  C#

摘要:DateTime t1 = DateTime.Parse("2007-01-01"); DateTime t2 = DateTime.Parse("2006-01-01"); System.TimeSpan t3 = t1 - t2; //两个时间相减 。默认得到的是 两个时间之间的天数 得到:36 阅读全文
posted @ 2020-09-22 15:20 apegu 阅读(3402) 评论(0) 推荐(0)
摘要:global.asax.cs文件添加如下代码 /// <summary> /// 移除http相应头 /// </summary> protected void Application_PreSendRequestHeaders() { Response.Headers.Remove("Server 阅读全文
posted @ 2020-09-15 16:05 apegu 阅读(1198) 评论(0) 推荐(0)
摘要:Github 地址:https://github.com/jasonhua95/awesome-dotnet-core awesome-dotnet-core .NET Core框架、库和软件的中文收录大全。内容包括:库、工具、框架、模板引擎、身份认证、数据库、ORM框架、图片处理、文本处理、机器学 阅读全文
posted @ 2020-02-04 22:24 apegu 阅读(863) 评论(0) 推荐(1)
摘要:private int DateDiff(DateTime dateStart, DateTime dateEnd) { DateTime start = Convert.ToDateTime(dateStart.ToShortDateString()); DateTime end = Convert.ToDateTime(dateEnd.ToShortDateString()); TimeSpa 阅读全文
posted @ 2020-01-05 23:09 apegu 阅读(7263) 评论(0) 推荐(0)
摘要:在写windows服务的时候需要用到多线程跑数据,执行方法中用lock锁住一段代码,记录日志后发现无效,没起作用。 program 代码如下: public class SearchParam { /// <summary> /// 消息类型 /// </summary> public int Ms 阅读全文
posted @ 2020-01-01 11:16 apegu 阅读(2372) 评论(0) 推荐(0)