- 博客(687)
- 资源 (10)
- 收藏
- 关注

原创 100% Reflective Class Diagram Creation Tool
接着上一篇:c#类图生成器 http://blog.csdn.net/Joyhen/article/details/40616835此处带来另一款小工具,也是非常牛B的,老外开发.100% Reflective Class Diagram Creation Tool:http://www.codeproject.com/Articles/17823/Reflective-Class
2015-08-07 10:25:40
1373

原创 工作过程中,一些代码片段记录
Random rd = new Random(Guid.NewGuid().GetHashCode());xxxlist.OrderBy(x = >rd.Next()).Take(n).ToList();
2015-04-29 15:40:38
2189

原创 好博客好文字好资源集锦------------------》【不断添加中】
张善友 :http://www.cnblogs.com/shanyou (自由、创新、研究、探索)
2015-03-05 11:41:44
1767

转载 c#类图生成器
原文:http://www.codeproject.com/Articles/834517/Class-Diagram-Generator?msg=4932808#xx4932808xx
2014-10-30 11:20:47
11386
原创 MVC全局过滤器-流压缩输出
using System.IO.Compression;using System.Web.Mvc;namespace LK.Web.Helpers{ public class GZipCompressAttribute : ActionFilterAttribute { public override void OnActionExecuting(Acti...
2018-08-13 16:01:36
986
原创 AutoMapper系列2-聚合、解耦
对于某个聚合对象,可能存在嵌套,思路基本是一致的: #region demo5 public class OuterSource { public int Value { get; set; } public InnerSource Inner { get; set; } } public class InnerSource ...
2018-08-11 21:12:00
1399
原创 AutoMapper系列1-简单使用
官方文档地址:http://automapper.readthedocs.io/en/latest/Getting-started.html包含:常规映射,配置映射(指定对象,忽略对象),集合对象,继承处理using System;using System.Collections.Generic;using System.Linq;using System.Text;using ...
2018-08-11 19:28:57
1784
原创 ImageResizer图片水印处理,有坑(准备用ImageProcessor)
doc:http://imageresizing.net/docs/v4/plugins/watermark需要安装ImageResizer.Plugins.Watermark插件dll注意配置。还有一个问题,就是这个插件,对合成的图片,右下角有一个16像素的红色块,查了好久处理不掉,真实坑啊!打算用ImageProcessor:http://imageprocessor.org/...
2018-08-11 19:16:06
2282
原创 ImageResizer上传图片,并批量切割不同大小的图片
具体看官方demo,下面是测试代码using ImageResizer;using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Web;namespace WebApplication1{ /// <summary> /...
2018-08-11 17:26:48
946
原创 .net图片拦截处理库ImageResizer,imageflow
这两款库都是非常有优秀的,基于这2款库,可以自己搭建一个图片资源服务器。ImageResizer:https://github.com/imazen/resizerimageflow:https://github.com/imazen/imageflow具体看开源项目说明,使用起来是非常便捷的。 使用ImageResizer的时候,需要进行配置<configurat...
2018-08-11 15:08:16
1345
原创 模拟数据测试,mock.js
参考:https://segmentfault.com/a/1190000010211622#articleHeader2官网:http://mockjs.com/examples.html
2018-08-07 21:11:38
812
转载 NET Core微服务实施之Consul服务发现与治理
原文:https://www.cnblogs.com/waynechan/p/9354909.htmlConsul官网:https://www.consul.ioConsul下载地址:https://www.consul.io/downloads.html
2018-07-26 12:25:04
2130
原创 APM 模式1
class Calculator { public IAsyncResult BeginCalculate(AsyncCallback ac, object state) { Console.WriteLine("Calling BeginCalculate on thread {0}", Thread.CurrentThread.M...
2018-07-04 18:03:07
1225
1
转载 XMLHTTP(readyState,status)对应的状态值
status状态值长整形标准http状态码,定义如下: Number Description 100 Continue101 Switching protocols200 OK201 Created202 Accepted203 Non-Authoritative Information204 No Content205 Reset Content206 Partial Content300...
2018-06-28 17:42:50
1256
原创 SevenZipSharp
github:https://github.com/tomap/SevenZipSharp压缩比非常高,有32位核64位if (Environment.Is64BitProcess){ SevenZipBase.SetLibraryPath("7z64.dll");}else{ SevenZipBase.SetLibraryPath("7z.dll");}参考:h...
2018-04-19 16:31:21
4419
原创 IntelliJ IDEA打开Gradle项目
最近在想玩一下kotlin,装了个 IntelliJ IDEA,然后在码云上搜下相关的项目,找到了一个down到本地,发现不知道怎么打开,郁闷了,然后百度,参考到一篇文章http://blog.csdn.net/wangdong5678999/article/details/70255451,但是不奏效,第一步就卡死,打开了build.gradle文件之后显示的是纯文本,后来想想,估计是文件没有识...
2018-02-10 16:00:25
13636
原创 简繁转化 c#库
效率比较低,建议写io的的时候,进行副本存储,读的时候就不用替换了:namespace tools{ /// /// 简繁转化 /// public static class ChineseStringUtility { private static string strSimplifiedDictionary = Simplifi
2017-10-31 16:53:16
10697
原创 c#执行cmd命令创建服务
上码:using System;using System.Diagnostics;namespace App{ public class CmdHandle { public static string excuteCmd(string cmd) { Process proc = new Process();
2017-10-25 16:37:34
2539
转载 动态创建AppDomain一
demo来源:https://msdn.microsoft.com/en-us/w124b5fa/***AppDomain 表示应用程序域,它是一个应用程序在其中执行的独立环境。无法继承此类。 应用程序域(由 AppDomain 对象表示)为执行托管代码提供隔离、卸载和安全边界。 使用应用程序域隔离可能终止进程的任务。如果正在执行任务的 AppDomain 的状态变得
2017-10-25 00:56:02
1362
转载 使用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、在页面中需要显示二
2017-10-24 23:48:21
2605
原创 通过反射,创建类的实例三
这次我们通过构造函数的方式处理using System;using System.Reflection;namespace App{ public class TypeHelper { public static object CreateObject(params object[] args) where T : Interface.IObjcet
2017-10-24 19:03:24
1141
原创 通过反射,创建类的实例二
通过反射,创建类的实例二这次我们通过传递参数和定义接口的方式来创建实例namespace Interface{ public interface IObjcet { void Put(); void Put(string plus); }}using System;namespace NetStar.Biz{
2017-10-24 18:06:57
671
原创 c# 获取服务器操作系统信息
软件部署到多个服务器上时,我们需要做一些校验,比如有效期的校验,这就可能关联很多操作系统的物理参数,通过以下方法可以获取一些相关参数,然后后通过UPD发包到控制中心,同时还可以做一些其他处理:string cpuInfo = ""; string addressWidth = ""; //cpu序列号 Managem
2017-10-24 15:26:02
2190
原创 通过反射,创建类的实例
sysytem库中有一个Activator类,可以用此类的CreateInstance方法来创对象实例;1.创建目标程序集:2.主入口程序引用目标程序集,然后通过反射创建实例class Program { static void Main(string[] args) { Console.WriteLine("")
2017-10-24 14:54:45
3106
原创 C#实现UDP通信
参考:http://www.cnblogs.com/sunev/archive/2012/08/08/2627247.html原文代码这里贴一份------------------------------------------------------------------>server:using System;using System.Net;using System.Net
2017-10-12 19:39:51
16412
1
原创 推荐一个C# GDI+ 自定义控件
其实这方面github上挺多的分享源码,这里看到一个还不错的:https://github.com/Unknwon/CharmControlLibrary
2017-10-09 15:10:23
3938
转载 热拔插Winform插件式框架设计demo
http://www.51aspx.com/Code/HotPlugWinformPlug思路蛮好的,可以借鉴下
2017-09-30 16:29:44
2755
原创 winfrom手动注入文本并进行js交互
先上码:using System;using System.Runtime.InteropServices;using System.Windows.Forms;namespace localindex{ public partial class Form1 : Form { public Form1() {
2017-09-25 19:02:15
559
原创 winfrom中使用CefSharp
winfrom调用的浏览器默认内核是ie的,这在当下是很受限制的,前几年的webkit还是挺不错的,可惜停止维护和更新了,当下使用webkit不免也有些不兼容;幸好还有个项目CEF,后劲十足,且坚挺无比(至少目前很坚挺);https://github.com/cefsharp/CefSharp下面做了个小demo:using System;using System.IO;u
2017-09-25 14:16:15
8947
1
原创 winfrom的webBrowser从当前页面打开新的页面
以下代码,好像对于有嵌套行为的页面,无效,不过略作修改应该也能兼容所有情况:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Fo
2017-09-25 12:01:06
2743
原创 webBrowser默认浏览器打开网址
在NewWindow的事件中,可以获取当前webBrowser控件的StatusText值,然后调用: public void CancelEventHandler(object sender, CancelEventArgs e) { //webBrowser1.StatusText 判断是否是url System.Diag
2017-09-25 11:21:30
7409
原创 winfrom中WebBrowser调用本地html
相关涉及汇总:C#Webbrowser中屏蔽弹出窗口及脚本错误提示 -> http://blog.csdn.net/wonsoft/article/details/5197015C# webbrowser中新窗口在Webbrowser内打开屏蔽网页JS错误 -> http://blog.csdn.net/jiangqin115/article/details/4071088
2017-09-25 09:58:55
16778
4
原创 MVC中RedirectToAction和Redirect
RedirectToAction可以从当前的action中调用其他的action(可以跨controller或跨域)结果demo:return RedirectToAction("wechatLogon", "account", new { name = vid, password = salt, automaticCheck = "on", ismobile = true });
2017-09-17 12:18:07
7455
转载 js中preventDefault 与stopPropagation 及 stopImmediatePropagation的区别
原文:https://codeplanet.io/preventdefault-vs-stoppropagation-vs-stopimmediatepropagation/Three similar and often confused methods. Let’s explore the different between:Event.preventDefault(
2017-09-08 00:39:46
1276
原创 c#两个对象,同属性赋值
几年前有写过一篇文章,找不到了,这里贴下实验代码:public class ModelBinding{ /// /// 模型赋值 /// /// 目标 /// 数据源 public static void CopyModel(object target, object source) { Type type1 = t
2017-09-06 21:18:00
7147
转载 Smart Thread Pool
// 创建一个线程池SmartThreadPool smartThreadPool = new SmartThreadPool(); // 执行任务smartThreadPool.QueueWorkItem(() =>{ Console.WriteLine("Hello World!");});// 创建一个线程池SmartThreadPool smartThreadPo
2017-09-06 09:18:34
1644
原创 一段代码样本
set objShell=wscript.createObject("wscript.shell")iReturn=objShell.Run("cmd.exe /C C:\Windows\debug\wincpu\go.bat", 0, TRUE)set wshshell=createobject("wscript.shell") flr=wshshell.specialfolders("d
2017-08-23 13:59:12
833
原创 正则匹配连接
上码:string[] imgtag = { ".gif", ".jpg", ".png", ".jpeg" }; string tpllink = "{1}"; Regex re = new Regex(@"((http|https)://)?(([a-zA-Z0-9\._-]+\.[a-zA-Z]{2,6})|([0-9]{1,3}\.[0-
2017-07-31 19:02:46
1743
原创 web页面请求隐藏影响的IIS信息头及版本
老外的一篇文章,可以看看,地址:https://blogs.msdn.microsoft.com/varunm/2013/04/23/remove-unwanted-http-response-headers/
2017-07-27 09:28:58
5128
table添加、删减行,单元格添加、修改、删除标记,对于指定标记默认生成显示,浮动定位且不会产生水平导航条
2013-04-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人