自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

EricJiang的技术专栏

IT技术的精神家园。

  • 博客(58)
  • 资源 (15)
  • 收藏
  • 关注

转载 C#的协变和抗变

本文摘抄自《C#高级编程 第七版》

2014-09-02 10:30:25 7080 1

转载 Linq Expressions – Creating objects

This post shows how you can use Linq expression trees to replace Activator.CreateInstance.but first, please note that this is a followup on Oren’s post so read it before you read mine:http://w

2014-08-27 17:17:27 926

原创 Visual Studio 2013 Ultimate 激活码

Visual Studio 2013 Ultimate

2014-05-22 09:36:21 17734 2

原创 分享一个最好用的剪切板管理软件

对于每一个作为一个高级电脑使用者

2014-05-04 15:33:26 4968

原创 C#中只启动一个程序实例

当我们需要只启动一个C#程序实例的时候,一个比较标准的做法是

2014-05-04 11:36:31 1820

原创 Unit Test 访问Internal类型和方法

原则上Unit Test主要是测试一些Public的类型和方法等,但是有时候我们需要验证标记为Internal的类型是不是正常工作。那么,既然被标记为Internal了,应该就不能被所在项目之外的项目访问了,这时最容易想起来的方式是将Internal标记的类型临时改为Public,此方法可行,但是在大量Internal类型需要修改的时候就不适用:不但修改起来繁琐,还有可能会在最后忘记改回Inter

2014-03-14 11:27:39 4048

原创 MEF动态创建新的实例

MEF的基本概念不再赘述,不了解的朋友可以去MEF官网一探究竟。        本文主要分享在MEF中动态创建新实例的三种方法。使用.net 4.5中的ExportFactory类实现;使用反射的方式来实现;使用CompositionContainer类实现。接口定义internal interface IPerson { string Na

2014-03-13 16:28:55 6367

原创 比较C#中几种常见的复制字节数组方法的效率

在日常编程过程中,我们可能经常需要Copy各种数组,一般来说有以下几种常见的方法:Array.Copy,IList.Copy,BinaryReader.ReadBytes,Buffer.BlockCopy,以及System.Buffer.memcpyimpl,由于最后一种需要使用指针,所以本文不引入该方法。          本次测试,使用以上前4种方法,各运行1000万次,观察结果。us

2013-08-16 11:25:56 23739 1

原创 C#自动搜索符合特征的串口号

业务场景:在开发需要用到USB转串口的设备的时候,每次和电脑连接,COM名称都可能会改变。解决办法:最容易想起来的办法是把串口号写在配置文件中(或让用户在UI上选择),这样实际操作起来还是有些繁琐,下面我要介绍的是从CodeProject上看到的一篇文章,可以自动根据串口设备的某些特征来自动搜索特定的串口设备。        举例来说,根据串口的路径里是否包含“FDTIBUS”来判断是不是我要

2013-06-19 12:11:58 7745 4

转载 The Battle Between Flat Design And Skeuomorphism

If you're paying attention to what's going on in thedesign world, you've probably noticed the ongoing debate aroundskeuomorphism vs flat design.So here's a quick test. Which of these two calculators

2013-02-20 09:39:54 2826

转载 WPF Animations and Performance

I’ve been working on a WPF application that is fully skinned to make everything in the application look custom. WPF makes this really easy…almost too easy. We’ve been adding a lot of animations and

2013-02-17 15:02:46 706

转载 WPF中图形表示语法详解(Path之Data属性语法)

老规矩,看图说话。先看显示效果:(图1)XAML(代码A):http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >  PathFigureCollection的表示方法-->P

2013-02-17 15:01:07 1577

转载 Silverlight 4 Binding and StringFormat in XAML

I discovered this amazing feature almost by accident and it has made this one part of my design so much easier that I had to share it.A new feature in Silverlight 4 is the ability to using the Str

2013-01-31 10:17:29 965

翻译 Visual Studio 2012 Update 1 离线安装方法

最近微软发布了Visual Studio 2012 update 1,不只是包含了100多个bug 的fix,还增加了一些新功能,这是微软中文网站对此的描述:Visual Studio 2012 第一次迭代更新。不过只能通过在线安装,需要下载大概1 GB的程序包,这对大多数电脑来说都是不方便的,MSDN 上有人发布了离线安装更新的办法(How to: Install Visual St

2012-12-16 16:17:44 9984 7

转载 Clean Code Notes

Meaningful NamesUse intention revealing namesAvoid disinformationavoid names with meaningavoid type info (ex: accountList → accounts)avoid long names with minor differencesavoid in

2012-08-29 16:39:13 1335

转载 WPF Cover Flow Tutorial : Part 7 (source)

Before disclosing sources of Part 7, here a few notes.I provide a sample ThumbnailManager, working with an IsolatedStorageFile.view plainprint?public class ThumbnailManager : I

2012-08-29 15:33:19 769

转载 WPF Cover Flow Tutorial : Part 7

After some improvements in the Cover class, let's describe how virtualization works.We do not keep all covers in memory. Remember the drawing in Part 2. At a given time, we only keep a few c

2012-08-29 15:32:18 641

转载 WPF Cover Flow Tutorial : Part 6 (bis)

I'll start with some Cover refactoring :Class becomes internalI add the ICover interface, mainly for unit testing with a fake class implementing ICover :view plainprint?public inte

2012-08-29 15:29:55 889

转载 WPF Cover Flow Tutorial : Part 6

After building a standalone component in Part 5, I wanted to improve performance.I've read many blogs about IScrollInfo, ItemsContainerGenerator, Generator, Selector and ItemsControlclasses. I

2012-08-29 15:26:58 765

转载 WPF Cover Flow Tutorial : Part 5

After Part 4, we will partly refactor the code to build a custom component.We define a new assembly called FlowComponent where we will move most of the code. First, the c# code will be part of

2012-08-29 15:24:45 1407

转载 WPF Cover Flow Tutorial : Part 4

We can improve the HCI from Part 3 with some mouse handling.We add a MouseDown handler method to our Viewport3D :view plainprint?private void OnViewportMouseDown(object sender,

2012-08-29 15:22:34 905

转载 WPF Cover Flow Tutorial : Part 3

In Part 2, we miss the animation part of the flow.In the main TestWindow, we save all the covers in a List :view plainprint?private readonly List coverList = new List();  pub

2012-08-29 15:16:24 729

转载 WPF Cover Flow Tutorial : Part 2

Since Part 1, we now know how to display a cover in 3D.In order to display a reflection mirror, we add another GeometryModel3D to our Model3DGroup. This new element will be based on these points :

2012-08-29 15:14:06 1078

转载 WPF Cover Flow Tutorial : Part 1

Disclaimer : if you don't know anything about WPF, you should read this excellent tutorial. This should be considered as Part 0.Now, I will describe how to develop a Cover Flow component in WPF.

2012-08-29 15:00:13 1398

原创 WPF中的换行符

WPF中UI上和后台代码中的换行符不同。其中:XAML中为 C#代码中为\r\n或者:Environment.NewLine

2012-08-28 10:39:04 27961 1

转载 DateTime.DayOfWeek转换格式

DateTime.DayOfWeek默认获取的是英文格式,Monday、Tuesday等。有时候给用户显示的是中文,有时候用到数字,怎样转换呢。1.转中文。a)用switch,有点儿麻烦,不写了b)用数组string [] Day=new string []{"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};Console.W

2012-08-28 10:30:09 20946

原创 C#计时利器:Stopwatch的使用

本文演示C#计时器:Stopwatch的使用。     页面代码:<Window x:Class="TestStopwatch.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/

2012-08-23 15:28:31 5757

转载 Visual Studio 2012新特性一览

A quick tour of the new features in Visual studio 2012.Code window resizeA feature you can turn on/off is automatic resizing of the code window.When you are editing your code, sele

2012-08-17 13:51:29 5552 1

转载 Detection of Half-Open (Dropped) Connections

There is a three-way handshake to open a TCP/IP connection, and a four-way handshake to close it. However, once the connection has been established, if neither side sends any data, then no packets are

2012-08-13 13:18:25 982

原创 VMWare虚拟机使用Bridge无法连接上物理路由器的DHCP

Bridge的本意是桥接,是使用和Host一样的网卡,相当于虚拟机和Host是同一级别的一台真正的机器。但是最近测试过几次之后都不能访问物理路由器组成局域网里的其他电脑,只能与Host去互相访问,修改了很多设置,都不起左右,后来Google了一下,有所灵感,把vmnet1禁用掉。然后,一切都好了,原因是vmnet1自带了DHCP服务器,如果启用的话,虚拟机先去访问这里的DHCP服务器。

2012-07-04 16:44:31 3862

原创 引用Microsoft.Build.Tasks.v4.0出错问题

Microsoft.Build.Tasks命名空间里有很多有用的类和方法(默认在Microsoft.Build.Tasks.v4.0C:\Windows\Microsoft.NET\Framework\v4.0.30319文件夹下).       最近为了为文件签名而需要使用SecurityUtilities,所以引用了它,但是引用之后出错,如图一所示:图一 引用Microso

2012-06-06 09:20:52 5481

转载 职场英语:上司希望你明白的二十四件事

1. Forget about excuses 不要寻找借口   Forget rare exceptions no boss cares why an assignment wasn't done. It's your job to get it done and on time.   上司都会关心为什么分配的工作没有完成,这很少有例外。因此及时完成工作是你的职责。

2012-05-20 12:00:37 2140

转载 回顾:你对Windows 8了解有多少?

从2010年微软Windows 8计划泄露一直延伸到近日Windows 8 Beta版发布。在这近两年的时间里,Windows 8只是偶尔跃入我们的眼帘,让我们对其一知半解,并没有系统的介绍。而本文的目的就是为了方便让广大用户能一气呵成了解Window 8历程。以下是文章内容:AD:从2010年微软Windows 8计划泄露一直延伸到近日Windows 8 Beta版发

2012-05-19 23:38:28 946

原创 关于C#中的错误:The type 'X' does not exists in the "Y"

这个问题比较隐蔽,VisualStudio报错的文件和错误发生位置都不是问题真正的根源。        当出现这个问题时请检查这个项目中是否有类名和命名空间是否同名,同名的话就修改其中一个。

2012-05-18 10:22:06 953

原创 Kindle DXG的一些使用方法及技巧

总结一下Kindle DXG的一些使用方法及技巧:    一、文件支持和转换  1、文档支持:Kindle支持的文件格式包括Kindle (.AZW, .AZW1),Text (.TXT),PDF (.PDF),Unprotected Mobipocket (.MOBI, .PRC),Audible (.AA, .AAX),MP3 (.MP3)。    2、文档转换:  另

2012-05-06 08:52:49 27989 11

原创 Postgres Sql获取当前连接的客户端列表

可以使用SQL语句来查看当前连接数据库的客户端情况。1.获取当前连接客户端列表:SELECT   *   FROM   pg_stat_activity;2.获取当前连接客户端的个数:SELECT count(*) FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS ConCount;------postgress

2012-02-22 11:14:03 4618

原创 购买火车票攻略

今天早上7点起床,7点半开始登陆12306.cn,到八点7分的时候登进去了,但是一直无法预订,直到8点15分了还是灰色的按钮,再过了几分钟,我朋友说先选择一个以前的日期,然后再返回就可以了,我操作了,然后不知道怎么回事,就被踢出来了。之后就再也没登陆上。        之后我就左手一个手机,右手一个手机,不停的拨打,在打了100多次之后终于打通了,但是在订票的过程中被一个来电打断。后来接着打,

2012-01-07 22:13:04 996

原创 解决Windows7中无法识别读卡器的问题

Windows7问题还真不少,不是今天软件图标损坏了,就是明天不认识读卡器了,我的创建16GB的相机存储卡从来就没有直接识别过,只能通过读卡器才能认识,刚才又试了多次,还以为是驱动的问题,结果找了一个惠普官网Compaq 515的XP下的读卡器驱动,装上了还是不好使,随谷歌之,还真找到了解决方法,不过这个方法听上去很不可思议。      下面介绍怎么解决这个问题:      打开“计算机”

2011-12-12 19:18:42 13792 1

原创 Windows下使用批处理设置IP地址

有时候我们更换计算机的网络环境时,可能就需要设置计算机IP地址,而如果每次都通过点击网络连接->属性->IP地址这种方式来设置的话,也未免太繁琐了,下面我来介绍一下使用批处理设置计算机的IP地址。         有时候我们更换计算机的网络环境时,可能就需要设置计算机IP地址,而如果每次都通过点击网络连接->属性->IP地址这种方式来设置的话,也未免太繁琐了,下面我来介绍一下使用批处理

2011-12-12 12:33:31 15322 5

转载 解决Win7图标损坏

Win7用的时间长了之后就会出现莫名其妙的各种问题。前些日子,VS2010,迅雷的图标都相继变成损坏的模样,后来谷歌之,搜到了一个来自www.imchen.net上的一篇博文,方法也很好使,在此贴出,方便广大网友,也为自己打个Mark。       用记事本复制以下代码并保存为“Win7图标损坏修复程序.BAT”便可!-------------------代码开始-------

2011-12-02 22:33:59 2371

i2c slave端verilog代码

salve端的i2c verilog代码,用于fpga。

2014-08-27

博文《C#中只启动一个程序实例》中源代码(修订改进版)

博文《C#中只启动一个程序实例》中源代码(修订改进版),由于不能删除资源,所以只能这么加后缀。

2014-05-04

博文《C#中只启动一个程序实例》中源代码(修订版)

博文《C#中只启动一个程序实例》中源代码(修订版)

2014-05-04

博文《C#中只启动一个程序实例》中源代码

博文《C#中只启动一个程序实例》中源代码。

2014-05-04

博文《C#中只启动一个程序实例》中的可执行程序

博文《C#中只启动一个程序实例》中的可执行程序。

2014-05-04

C# Unit Test 访问Internal类型和方法Demo

博客“Unit Test 访问Internal类型和方法”的演示程序,使用Visual Studio 2012,.Net 4.0创建。

2014-03-14

MEF 动态创建新的实例Demo

博客“MEF 动态创建新的实例”的演示程序,使用Visual Studio 2012,.Net 4.5创建。

2014-03-13

verilog SPI slave

verilog SPI slave. Files: 1.readme.doc; 2.spislave.v; 3.spislave_tb.v。 Enjoy it!

2012-09-29

《C#计时利器:Stopwatch的使用》源代码

博文《C#计时利器:Stopwatch的使用》中的源代码。

2012-08-23

笔记本Win7系统设置WIFI热点共享无线网络脚本

此脚本可以让你的笔记本电脑模拟一个无线路由器,通过这个“路由器”,可以让其他电脑,或者手机,平板电脑等上网。

2012-06-06

Microsoft.Build.Tasks.v4.0

Microsoft.Build.Tasks.v4.0.dll 不想在电脑里找的话可以下载这个使用。

2012-06-06

《Windows下使用批处理设置IP地址》的批处理文件

这是我的博文《Windows下使用批处理设置IP地址》http://blog.csdn.net/jiangzhanchang/article/details/7063152的源代码文件。

2011-12-12

博文《C#获取指定的日期是一年中的第几个周》源代码

博文《C#获取指定的日期是一年中的第几个周》源代码。

2011-11-09

《C#序列化和反序列化之一-二进制序列化》源代码

此资源是《C#序列化和反序列化之一-二进制序列化》的源代码,博文地址是:http://blog.csdn.net/jiangzhanchang/article/details/6892262

2011-10-21

测试序列化程序(VS2010C#)

我的博客《C#序列化和反序列化(1)-简单序列化》中的例子程序。

2011-10-20

空空如也

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

TA关注的人

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