自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(46)
  • 收藏
  • 关注

原创 C# 中的扩展方法

1.是否有子元素public static bool HasElements(this ICollection items){ return items != null && items.Count > 0;}2.IsBetweenpublic static bool IsBetween(this T value, T low, T high) wher

2015-07-01 17:40:01 290

转载 注册成为Windows Phone开发者并且解锁Windows Phone 8.1手机

点击打开链接地址:

2015-03-06 17:51:38 271

转载 SQL中使用WITH CTE

递归CTE最少包含两个查询(也被称为成员)。第一个查询为定点成员,定点成员只是一个返回有效表的查询,用于递归的基础或定位点。第二个查询被称为递归成员,使该查询称为递归成员的是对CTE名称的递归引用是触发。在逻辑上可以将CTE名称的内部应用理解为前一个查询的结果集。;WITH CTE AS ( SELECT * FROM Channel a WHERE 条件 UNION ALL

2015-03-05 11:27:27 847

转载 boost中的mutex与lock

基本用法:HANDLE g_mutex = NULL; void test() { ::WaitForSingleObject(g_mutex, INFINITE); //do something... ReleaseMutex(g_mutex); } 封装:class MyMutex { public: MyMutex()

2014-12-17 15:18:39 830

转载 [置顶] 完成端口(CompletionPort)详解 - 手把手教你玩转网络编程系列之三

手把手叫你玩转网络编程系列之三   完成端口(Completion Port)详解                                                             ----- By PiggyXP(小猪)前 言        本系列里完成端口的代码在两年前就已经写好了,但是由于许久没有写东西了,不知该如何提笔,

2014-12-09 18:04:36 557

转载 WM_NOTIFY和ON_NOTIFY macro及OnNotify虚函数

WM_NOTIFY是子控件用来向父窗体发送信息的消息,其参数一般以NMHDR结构来封装,例如            NMHDR nmh;            memset(&nmh,0,sizeof(NMHDR));            nmh.hwndFrom = GetSafeHwnd();            nmh.idFrom = GetDlgCtrlID();

2014-11-26 13:40:55 388

翻译 C#通用字符串解析

问题--olou

2014-11-14 14:16:52 320

原创 JS集锦

1 .$(".tt-item .cf>li").each(function () { if ($('a', this).hasClass("current")) { var indexr0 = $(".tt-item .cf>li").index(this); saveTabIndexa

2014-11-10 10:14:37 277

转载 String.Format in JavaScript

JavaScript String.Format // This is the function. String.prototype.format = function (args) { var str = this; return str.replace(String.prototype.format.regex, function(item) { var

2014-11-10 09:24:10 284

转载 模板在EventHandler 和EventArgs的应用

1.public class ItemEventArgs : EventArgs{ public ItemEventArgs(T item) { Item = item; } public T Item { get; protected set; }}

2014-11-07 15:26:37 265

转载 Generic Thread Start

// ParameterizedThreadStart.cspublic delegate void ParameterizedThreadStart(T value); // ParameterizedThread.csusing System.Threading; public class ParameterizedThread{ private Parameterize

2014-11-07 14:46:46 363

转载 Using C# 2.0 Generics to achieve a reusable Singleton pattern

一般代码: public sealed class Singleton { Singleton() { } public static Singleton Instance { get { return Singleto

2014-11-07 14:15:14 249

翻译 用"dynamic" 使 PInvoke 更简单

代码:dynamic user32 = new DynamicDllImport("user32.dll", callingConvention : CallingConvention.Winapi);user32.MessageBox(0, "Hello World", "Platform Invoke Sample", 0);

2014-11-07 09:31:19 225

翻译 同步更新缓存数据

标准的缓存机制,开发者需要填充它然后它自动无效后内容过期。在随后的方法缓存机制将自动填充以及自动失效。从编码器的角度来看,你将有权使用模式来检索数据并提供一种方法,当其寿命。换句话说,机制转换为一个抽象方法的抽象类的下面:

2014-11-06 13:16:26 310

翻译 数据缓存

数据从一个存储库获得完全可以从性能的角度来看一个“重”的任务,尤其是当数据库位于远t应用服务器(例如,Web服务调用,调用,远程处理等)或一些特定的数据是经常访问。因此,为了减少数据检索工作量及时间,你可以使用一个缓存功能。

2014-11-06 10:04:31 289

转载 Sqlite使用事务插入数据

using System.Data;using System.Data.Common;using System.Data.SQLite;// 创建数据库文件File.Delete("test1.db3");SQLiteConnection.CreateFile("test1.db3");DbProviderFactory factory = SQLiteFactory.Instan

2014-11-04 16:53:36 1054

转载 var 与 dynamic的不同

vardynamicIntroduced in C# 3.0Introduced in C# 4.0Statically typed – This means the type of variable declared is decided by the compiler at compile time.Dynamical

2014-11-04 11:35:35 291

转载 .Net and C# release history

.Net Version Release history.Net VersionRelease DateToolFeature1.02002Visual Studio .NetFirst release of .net1.12003Visual Studio 2003Suppor

2014-11-04 11:16:50 339

翻译 Func用法

What is Func?Func in short is parameterized delegate. In C#, a delegate instance points towards a method. When a caller invokes the delegate, it calls its target method. This way, the caller i

2014-11-04 09:29:07 1668

翻译 Emit with a human face

IntroductionThe System.Reflection.Emit namespace provides classes to create dynamic assemblies at runtime. It allows compilers and tools to emit MSIL, execute it and store it to a disk. Although

2014-11-03 10:21:39 374

翻译 创建自定义用户登录 ( MVC 4 Razor)

原文地址:http://www.codeproject.com/Articles/482546/Creating-a-custom-user-login-form-with-NET-Csharp

2014-11-03 09:28:45 536

翻译 代替Activator.CreateInstance

我发现 that the quickest way to instantiate an object with a default constructor through Reflection is by using the DynamicMethod class. Below is a helper class I wrote to easily instantiate an objec

2014-11-03 09:07:32 416

翻译 在MVC中用枚举型的下拉框

创建一个枚举型Create an enum, ActionType

2014-11-03 08:57:32 970

翻译 ExportAttribute, ImportAttribute, CompositionContainer and MEF in ASP.NET MVC 3

Introduction

2014-11-02 22:04:48 1611

转载 C# Lazy<T>(转)

1. Lazy 概述我们也许会遇到这样一种情况,我们有一个大家伙(大对象)需要创建,那么这个对象的创建时需要较长的时间,同时也需要在托管堆上分配较多的空间。那么在.NET Framework 4 中提供了这样一个很聪明的方式:Lazy(我们可以称之为懒对象)。当然,在之前,很多人也曾对其进行过自己的实现。那么我们在这里就可以把 Lazy 的作用总结为一句话,按需延迟加载。

2014-11-02 21:21:09 353

原创 正则表达式如何得到匹配的值

(?([\w]*))日matchcollection mc=regex.match(te

2014-10-31 14:36:38 1223

原创 SQL集锦

select ROW_NUMBER() over(order by id asc) as 'rowNumber', * from table1   生成带序号的集合2:再查询该集合的 第 1  到第 5条数据    select * from     (select ROW_NUMBER() over(order by id asc) as 'rowNumber', *

2014-10-31 11:23:27 226

翻译 Mapping Properties to String Keys

Introduction

2014-10-30 16:12:28 364

原创 SQLite连接字符串

Data Source=filename;Version=3;Pooling=False;Max Pool Size=100;

2014-10-30 09:01:46 1603

翻译 Using SQLMetal code generator tool for LINQ to SQL

SQLMetal这是一个代码生成工具由微软基于LINQ的发展援助。该工具只建立编码和映射,您就不必手工。除非你有Visual Studio 2008集成开发环境。即使是这样的一个拖放表和其他数据库对象的LINQ to SQL环境。在一个开发团队工作时,由DBA或其它开发商数据库的变化将需要纳入你的开发环境。你将需要删除并重新创建每个数据库对象的LINQ每次更改SQL环境。不用说,这将成为执

2014-10-29 16:15:45 395

原创 SQL Servier插件SQL Prompt 5使用

SQL Servier插件SQL Prompt 5使用

2014-10-29 16:09:57 578

转载 无边窗体在任务栏上的系统菜单

我们可能会用到一个没有边框的窗体,因为这样我们可以在整个窗体上自由的绘制。然后我们也会发现一个讨厌的问题,这个时候在任务栏上鼠标右键点不出那可爱的系统菜单了。这样会不好,会使得用户感觉到没有道理,为什么别的窗口都有系统菜单,而只有我们的窗体没有系统菜单呢?  其实如果我们使用VC建立MFC程序的时候,我们可以把窗体的“Title Bar”设置为False,这样MFC的窗口就是无标题的,然而

2014-10-29 14:42:56 433

翻译 win8下SQL管理器附加数据库解决方法

win8系统下SQL2008附加数据库出错,出现拒绝访问错误 ,

2014-10-28 21:01:35 330

原创 js调用winform公共方法

1.给form加上[System.Runtime.InteropServices.ComVisible(true)]

2014-10-24 09:44:14 400

原创 设计模式

Creational PatternsFactory - This pattern is used to create concrete class instances without specifying the exact class type.  Abstract Factory - This pattern is used to create concrete class

2014-10-22 14:45:03 218

翻译 JavaScript patterns simplified--javascript模式

Adapter Design Pattern in C#介绍

2014-10-22 13:28:03 305

翻译 Customizing View Engines—定制MVC3视图引擎

第一步:Step 1: Go to the Global.asax

2014-10-20 14:17:20 419

翻译 ASP.NET SignalR Basis Step by Step

转载f

2014-10-20 13:46:05 497

转载 将Log4net的配置配置到的独立文件中

在独立的配置文件中只需要修改几个地方就能完成:1. 新建一个配置文件,log4net.config配置方法同成web.config或app.config一致;2.如果windows应用程序请把配置文件设为:复制到输出目录 修改方法:在log4net.config上右击-->属性--->把"复制到输出目录" 值改为true; 3.在要用到log4的地方命名空间上边加上:[as

2014-10-20 11:36:25 268

原创 Log4net.config配置文件

<!-- .NET application configuration file This file must have the exact same name as your application with .config appended to it. For example if your applicatio

2014-10-20 11:13:28 481

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除