随笔分类 -  C#

摘要:public static string PostHttpResponse(string url, Encoding encoding, string parameters) { if (string.IsNullOrEmpty(url)) { throw new ArgumentNullExcep 阅读全文
posted @ 2020-02-26 18:15 lhd0525 阅读(267) 评论(0) 推荐(0)
摘要:1、DataTable 分组操作 阅读全文
posted @ 2018-04-27 11:45 lhd0525 阅读(670) 评论(0) 推荐(0)
摘要:Student 类: Demo: 输出结果: 阅读全文
posted @ 2018-03-10 21:44 lhd0525 阅读(9528) 评论(0) 推荐(1)
摘要://对象深拷贝 public static T Copy(T oldObject) where T : class,new() { T newOrder = new T(); MemoryStream stream = new MemoryStream(); BinaryFor... 阅读全文
posted @ 2017-11-15 22:36 lhd0525 阅读(445) 评论(0) 推荐(0)
摘要:DataTable 获取某一列的所有值 DataTable dt; var list = dt.AsEnumerable.Select<DataRow,string>(x=>x["列名"].ToString()).ToList<string>(); 阅读全文
posted @ 2017-10-12 19:10 lhd0525 阅读(408) 评论(0) 推荐(0)
摘要:应用背景:以货品为例,在基础数据中配置货品的判断规则,要根据这个规则筛选出符合条件的集合。 创建货品类 主要实现方法 阅读全文
posted @ 2017-09-02 11:04 lhd0525 阅读(3568) 评论(0) 推荐(0)
摘要:1、正实数 ^(0|[1-9]\d*)(\.\d*)?$ 2、正整数 ^[+]{0,1}(\d+)$ 阅读全文
posted @ 2017-08-16 14:25 lhd0525 阅读(112) 评论(0) 推荐(0)
摘要:string s = "Thu Mar 1 00:00:00 UTC+0800 2012"; DateTime dt = DateTime.ParseExact(s, "ddd MMM d HH:mm:ss UTCK yyyy", new CultureInfo("en-GB")); 阅读全文
posted @ 2017-07-27 18:19 lhd0525 阅读(289) 评论(0) 推荐(0)
摘要:C#编程语法中break ,continue, return这三个常用的关键字的学习对于我们编程开发是十分有用的,那么本文就向你介绍break ,continue, return具体的语法规范。 C#编程语法中我们会碰到break ,continue, return这三个常用的关键字,那么关于这三个 阅读全文
posted @ 2017-05-15 16:24 lhd0525 阅读(174) 评论(0) 推荐(0)
摘要:通过NPOI解析Excel,将数据保存到DataTable中。 阅读全文
posted @ 2016-12-20 09:52 lhd0525 阅读(518) 评论(0) 推荐(0)
摘要:在程序发布到服务器上的时候,不能在像本地执行一样可以调试,在发生错误时候,往往不能很方便的查找错误。将错误信息写入文件是一种比较常用的处理方法。以下是一个日志类,实现以下功能: 1)按日期每天生产不同日志文件,方便按照日期来查找日志。 2)按日志类型生产不同的文件,比如 跟踪信息、警告信息、错误信息 阅读全文
posted @ 2016-12-13 16:54 lhd0525 阅读(304) 评论(0) 推荐(0)
摘要:核心代码 测试: 类Test1 类Test2 调用 阅读全文
posted @ 2016-12-11 21:52 lhd0525 阅读(370) 评论(0) 推荐(0)
摘要:HTTP错误404.13 - Not Found 请求筛选模块被配置为拒绝超过请求内容长度的请求,原因是Web服务器上的请求筛选被配置为拒绝该请求,因为内容长度超过配置的值(IIS 7 默认文件上传大小时30M)。 解决方法 1. 修改IIS的applicationhost.config a.文件位 阅读全文
posted @ 2016-12-07 17:33 lhd0525 阅读(191) 评论(0) 推荐(0)
摘要:using (table) { IWorkbook workbook = new HSSFWorkbook(); ISheet sheet = workbook.CreateSheet(); IRow headerRow = sheet.CreateRow(0); ... 阅读全文
posted @ 2016-10-09 15:10 lhd0525 阅读(1524) 评论(0) 推荐(0)
摘要:方法2 阅读全文
posted @ 2016-10-09 11:51 lhd0525 阅读(180) 评论(0) 推荐(0)
摘要:List ciList = new List(); List tempItemList = new List(); if (cfxxModel != null && cfxxModel.content != null && cfxxModel.content.prescriptionItems != null) ... 阅读全文
posted @ 2016-08-29 22:47 lhd0525 阅读(4705) 评论(0) 推荐(0)
摘要:本篇文章旨在.net环境下生成xml文件,以控制台应用程序为例进行说明。 1、在vs中新建控制台应用程序CreateXml 2、CreateXmlFile:主要生成xml的函数 3、调用程序: 4、运行结果 阅读全文
posted @ 2016-08-19 10:07 lhd0525 阅读(1029) 评论(0) 推荐(0)
摘要:1、比较字符串 String 类提供了一系列的方法用于字符串的比较,如CompareTo 和 Equals方法等。 ① CompareTo : 如果参数的值与此实例相等,则返回0;如果此实例大于参数的值,则返回1;否则返回-1。 string str1 = "abc"; int m1 = str1. 阅读全文
posted @ 2016-08-18 22:23 lhd0525 阅读(344) 评论(0) 推荐(0)