随笔分类 -  .net fundamentals

1

zz decimal,float和double的区别
摘要:http://www.cnblogs.com/yellowapplemylove/archive/2011/08/23/2150316.html 一直很奇怪C#的预定义数据类型中为什么加了一个decimal,有float和double不就够了吗?今天来挖一挖。 浮点型 Name CTS Type D 阅读全文

posted @ 2015-10-09 20:51 oyl 阅读(293) 评论(0) 推荐(0)

Semantic Logging
摘要:http://blogs.msdn.com/b/agile/archive/2013/02/07/embracing-semantic-logging.aspx13: The Semantic Logging Application Blockfinal version isreleased. Ge... 阅读全文

posted @ 2015-10-08 23:19 oyl 阅读(334) 评论(0) 推荐(0)

zz微软企业库
摘要:很好的一个系列,学习。http://www.cnblogs.com/virusswb/category/241315.html有很多的框架还是可以用的,而且微软这两年对开源的态度也有所转变,只是由于商业上的考虑,开的力度不像大家想象的那么大,http://www.codeplex.com/就是微软创... 阅读全文

posted @ 2015-10-08 14:50 oyl 阅读(270) 评论(0) 推荐(0)

zz flag attribute for enum
摘要:http://blog.sina.com.cn/s/blog_429fe72e010006u3.html[SerializableAttribute][AttributeUsageAttribute(AttributeTargets.Enum, Inherited = false)][ComVisi... 阅读全文

posted @ 2015-10-08 11:45 oyl 阅读(242) 评论(0) 推荐(0)

zz .net memcache
摘要:http://www.cnblogs.com/mingh/archive/2009/11/06/1597266.html一,准备 你需要有一下软件: VS.NET(05/08) SQLSERVER memcached服务器端以及客户端类库(开源软件,下载即可)其中,客户端类库包括以下几个DLL: M... 阅读全文

posted @ 2015-09-25 13:33 oyl 阅读(215) 评论(0) 推荐(0)

(转)IOC框架Ninject实践总结
摘要:http://www.cnblogs.com/jeffwongishandsome/archive/2012/04/15/2450462.html一、控制反转和依赖注入Ninject是一个轻量级的基于.Net平台的依赖注入(IOC)框架。所谓的IOC,即控制反转(Inversion of Contr... 阅读全文

posted @ 2015-07-17 17:06 oyl 阅读(262) 评论(0) 推荐(0)

Ninject-1
摘要:http://www.cnblogs.com/tylerdonet/p/3297915.html1.为什么要用Ninject?Ninject是一个IOC容器用来解决程序中组件的耦合问题,它的目的在于做到最少配置。其他的的IOC工具过于依赖配置文件,需要使用assembly-qualified名称来进... 阅读全文

posted @ 2015-07-17 16:14 oyl 阅读(151) 评论(0) 推荐(0)

(转)C#4.0的dynamic和var及object关键字辨析
摘要:http://www.cnblogs.com/Mainz/archive/2011/03/10/1980060.html 1: dynamic a = 10; 2: a = a + 10; 3: Console.WriteLine(a.GetType());此段代码会输出 Syst... 阅读全文

posted @ 2015-07-17 13:12 oyl 阅读(189) 评论(0) 推荐(0)

(转)显示实现接口目的
摘要:当我们定义接口的成员的时候不需要写访问控制符,因为它是默认 public 的,也只能是 public。当一个类要实现这个接口的时候,自然要公开其成员。一直以来我都这么做。interface Interface1 { string GetName(string name); }class Class... 阅读全文

posted @ 2015-07-15 09:12 oyl 阅读(215) 评论(0) 推荐(0)

用stopWatch统计运行时间,性能分析
摘要:.net提供StopWatch.Start(), StopWatch.Stop(); StopWath.Elapsed 来统计运行时间;默认其是累计时间的,要重新开始,用reset()命令重置下用System.Now或者Enviroment.TickCount减来计算时间,不是很准确,与用stopw... 阅读全文

posted @ 2009-06-29 10:38 oyl 阅读(364) 评论(0) 推荐(0)

.net3.0 extension methods for interface
摘要:.net得扩展方法用在接口上,能使得用户不需要实现,额外获得一些方法:publicinterfaceICollectionControlVisualInformationHelper{int VisualIndexofCurrentItem(Control targetControl, IColle... 阅读全文

posted @ 2009-06-22 18:24 oyl 阅读(224) 评论(0) 推荐(0)

yield关键字, default关键字, 别名关键字
摘要:1.yield返回IEnumberable接口对象,使其可以支持foreach迭代。yeild return用于返回值,yeild break用于中断迭代。迭代器的返回类型必须为IEnumerable、IEnumerator、IEnumerable或IEnumerator。如:publicclass... 阅读全文

posted @ 2009-05-27 15:07 oyl 阅读(435) 评论(0) 推荐(0)

.net 添加文本到文本文件
摘要:StreamWriter没有Append方法,只能用seek设置位置,然后stream.WriteLine() 或stream.write(),这样会覆盖原来的文本。找到需要添加行的位置,把要添加的行+原来后面所有的内容,再write()void AppendText(FileInfo file){... 阅读全文

posted @ 2009-04-07 18:50 oyl 阅读(228) 评论(0) 推荐(0)

namepace and assembly
摘要:Assembly will contain Namespaces, Classes, Data types it’s a small unit of code for deployment. Assembly defines the name of the .dll file.Namespace i... 阅读全文

posted @ 2009-04-07 10:53 oyl 阅读(167) 评论(0) 推荐(0)

zz .Net 3.0新语法
摘要:Lambda表达式 :在C#2.0及C#1.x中,需要使用delegate来定义方法指针。如下面的代码如示:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-... 阅读全文

posted @ 2009-03-16 13:04 oyl 阅读(337) 评论(0) 推荐(0)

.net反射解析dll时 关联dll的加载
摘要:问题:一个解析器:using System;using System.Reflection;using System.Collections.Generic;using System.Text;classProgram{ staticvoid Main(string[] args) { string... 阅读全文

posted @ 2008-10-28 13:07 oyl 阅读(1157) 评论(0) 推荐(0)

.net Thread process UI
摘要:假设线程A创建了窗口W,同时为了工作需要线程A有创建了工作线程B。 STA中,对窗口W中与UI(界面)相关属性的修改,必须在创建窗口的线程A中完成。换句话说,线程B不允许修改W的UI属性(否则抛出InvalidOperationException,消息“Control control name ac... 阅读全文

posted @ 2008-08-24 18:15 oyl 阅读(414) 评论(0) 推荐(0)

[STAThread]的含义
摘要:[STAThread]STAThread:Single Thread Apartment Thread.(单一线程单元线程)[]是用来表示Attributes;[STAThread]是一种线程模型,用在程序的入口方法上(在C#和VB.NET里是Main()方法),来指定当前线程的ApartmentS... 阅读全文

posted @ 2008-08-24 16:53 oyl 阅读(249) 评论(0) 推荐(0)

STA thread
摘要:C#程序的主函数写[STA Thread] 属性是什么目的?(What is the purpose of the [STA Thread] attribute for the Main method of a C# program? )C#中,[STAThread]代表什么意思?如何用?> Sin... 阅读全文

posted @ 2008-08-24 16:50 oyl 阅读(921) 评论(0) 推荐(0)

VS2008 察看与调试.net源代码设置
摘要:Configuring Visual Studio to Debug .NET Framework Source CodeIt's finally here - the launch of the .NET Reference Source project. This post (hopefully... 阅读全文

posted @ 2008-08-10 20:43 oyl 阅读(415) 评论(1) 推荐(0)

1

导航