MVC全局过滤器-流压缩输出 using System.IO.Compression;using System.Web.Mvc;namespace LK.Web.Helpers{ public class GZipCompressAttribute : ActionFilterAttribute { public override void OnActionExecuting(Acti...
AutoMapper系列2-聚合、解耦 对于某个聚合对象,可能存在嵌套,思路基本是一致的: #region demo5 public class OuterSource { public int Value { get; set; } public InnerSource Inner { get; set; } } public class InnerSource ...
AutoMapper系列1-简单使用 官方文档地址:http://automapper.readthedocs.io/en/latest/Getting-started.html包含:常规映射,配置映射(指定对象,忽略对象),集合对象,继承处理using System;using System.Collections.Generic;using System.Linq;using System.Text;using ...
ImageResizer图片水印处理,有坑(准备用ImageProcessor) doc:http://imageresizing.net/docs/v4/plugins/watermark需要安装ImageResizer.Plugins.Watermark插件dll注意配置。还有一个问题,就是这个插件,对合成的图片,右下角有一个16像素的红色块,查了好久处理不掉,真实坑啊!打算用ImageProcessor:http://imageprocessor.org/...
ImageResizer上传图片,并批量切割不同大小的图片 具体看官方demo,下面是测试代码using ImageResizer;using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Web;namespace WebApplication1{ /// <summary> /...
.net图片拦截处理库ImageResizer,imageflow 这两款库都是非常有优秀的,基于这2款库,可以自己搭建一个图片资源服务器。ImageResizer:https://github.com/imazen/resizerimageflow:https://github.com/imazen/imageflow具体看开源项目说明,使用起来是非常便捷的。 使用ImageResizer的时候,需要进行配置<configurat...
模拟数据测试,mock.js 参考:https://segmentfault.com/a/1190000010211622#articleHeader2官网:http://mockjs.com/examples.html
NET Core微服务实施之Consul服务发现与治理 原文:https://www.cnblogs.com/waynechan/p/9354909.htmlConsul官网:https://www.consul.ioConsul下载地址:https://www.consul.io/downloads.html
APM 模式1 class Calculator { public IAsyncResult BeginCalculate(AsyncCallback ac, object state) { Console.WriteLine("Calling BeginCalculate on thread {0}", Thread.CurrentThread.M...
XMLHTTP(readyState,status)对应的状态值 status状态值长整形标准http状态码,定义如下: Number Description 100 Continue101 Switching protocols200 OK201 Created202 Accepted203 Non-Authoritative Information204 No Content205 Reset Content206 Partial Content300...
SevenZipSharp github:https://github.com/tomap/SevenZipSharp压缩比非常高,有32位核64位if (Environment.Is64BitProcess){ SevenZipBase.SetLibraryPath("7z64.dll");}else{ SevenZipBase.SetLibraryPath("7z.dll");}参考:h...
IntelliJ IDEA打开Gradle项目 最近在想玩一下kotlin,装了个 IntelliJ IDEA,然后在码云上搜下相关的项目,找到了一个down到本地,发现不知道怎么打开,郁闷了,然后百度,参考到一篇文章http://blog.csdn.net/wangdong5678999/article/details/70255451,但是不奏效,第一步就卡死,打开了build.gradle文件之后显示的是纯文本,后来想想,估计是文件没有识...
简繁转化 c#库 效率比较低,建议写io的的时候,进行副本存储,读的时候就不用替换了:namespace tools{ /// /// 简繁转化 /// public static class ChineseStringUtility { private static string strSimplifiedDictionary = Simplifi
c#执行cmd命令创建服务 上码:using System;using System.Diagnostics;namespace App{ public class CmdHandle { public static string excuteCmd(string cmd) { Process proc = new Process();
动态创建AppDomain一 demo来源:https://msdn.microsoft.com/en-us/w124b5fa/***AppDomain 表示应用程序域,它是一个应用程序在其中执行的独立环境。无法继承此类。 应用程序域(由 AppDomain 对象表示)为执行托管代码提供隔离、卸载和安全边界。 使用应用程序域隔离可能终止进程的任务。如果正在执行任务的 AppDomain 的状态变得
使用jquery.qrcode生成二维码 原文:https://www.helloweba.com/view-blog-226.html1、首先在页面中加入jquery库文件和qrcode插件。 type="text/javascript" src="jquery.js"> type="text/javascript" src="jquery.qrcode.min.js"> 2、在页面中需要显示二
通过反射,创建类的实例三 这次我们通过构造函数的方式处理using System;using System.Reflection;namespace App{ public class TypeHelper { public static object CreateObject(params object[] args) where T : Interface.IObjcet
通过反射,创建类的实例二 通过反射,创建类的实例二这次我们通过传递参数和定义接口的方式来创建实例namespace Interface{ public interface IObjcet { void Put(); void Put(string plus); }}using System;namespace NetStar.Biz{
c# 获取服务器操作系统信息 软件部署到多个服务器上时,我们需要做一些校验,比如有效期的校验,这就可能关联很多操作系统的物理参数,通过以下方法可以获取一些相关参数,然后后通过UPD发包到控制中心,同时还可以做一些其他处理:string cpuInfo = ""; string addressWidth = ""; //cpu序列号 Managem