摘要: 一、基类源码 SingleBase.cs /// <summary> /// 单例模式 /// </summary> /// <typeparam name="T"></typeparam> public class SingleBase<T> { static T instance = defau 阅读全文
posted @ 2018-10-19 17:08 by-lhc 阅读(2677) 评论(0) 推荐(1) 编辑
摘要: 一、新建windows服务项目,并从nuget引用下图标记的类库: 二、鼠标右键单击Service1.cs,点击查看代码,把类文件修改成如下: Service1.cs 三、在windows服务项目下建一个Config文件夹,并添加quartz_jobs.xml配置文件如下: quartz_jobs. 阅读全文
posted @ 2018-10-15 12:04 by-lhc 阅读(5693) 评论(0) 推荐(0) 编辑
摘要: 一、创建切面类 引用圈起来的2个类库,从nuget里面找。 ApiClientAttribute.cs 二、切面类的使用 DefaultClient.cs 阅读全文
posted @ 2018-10-09 14:50 by-lhc 阅读(392) 评论(0) 推荐(0) 编辑
摘要: 一、创建实体类、实体类工厂 ReturnMsg.cs ReturnMsgFac.cs 二、创建切面类 引用圈起来的4个类库,框架没有的就从nuget里面找。 APIInitAttribute.cs 三、切面类的使用 DefaultController.cs 阅读全文
posted @ 2018-10-08 15:59 by-lhc 阅读(345) 评论(0) 推荐(0) 编辑
摘要: 1.异步方法的定义 2.异步方法的调用 阅读全文
posted @ 2018-09-18 16:31 by-lhc 阅读(2233) 评论(0) 推荐(0) 编辑
摘要: 1.存储过程 数据库函数exec()执行sql字符串有“sql注入风险”,不推荐使用! 2.调用存储过程的方法 阅读全文
posted @ 2018-04-24 09:48 by-lhc 阅读(1273) 评论(0) 推荐(0) 编辑
摘要: 1.AppSettingExtension类的实现 2.配置文件示例(@"~/App_Data/AppSettingsConfig.xml") 阅读全文
posted @ 2018-04-11 18:46 by-lhc 阅读(3438) 评论(0) 推荐(0) 编辑
摘要: Web.config file: <?xml version="1.0" encoding="utf-8"?><configuration><appSettings configSource="Config\app.config"></appSettings></configuration> Ps. 阅读全文
posted @ 2018-04-11 17:28 by-lhc 阅读(195) 评论(0) 推荐(0) 编辑
摘要: CancellationTokenSource cts = new CancellationTokenSource(); ParallelOptions pOptions = new ParallelOptions() { CancellationToken = cts.Token }; pOptions.MaxDegreeOfParallelism = 3;//设置并发线程数量 Parall... 阅读全文
posted @ 2018-01-15 11:30 by-lhc 阅读(1967) 评论(0) 推荐(0) 编辑
摘要: 一、开篇描述 本篇博客所描述的断点续传功能是基于c#语言,服务器端采用.net mvc框架,客户端采用winform框架。 本篇博客实现断点续传功能的基本思路:1)服务器端是把接收到的文件流,追加到已有的文件;2)客户端是把文件流截段上传; 其实,任何一种计算机语言基于这个思路(web客户端Java 阅读全文
posted @ 2017-11-06 17:48 by-lhc 阅读(4269) 评论(0) 推荐(1) 编辑