07 2013 档案

摘要:用C#实现一个类的IEnumerable接口时有两种方法:1)实现非泛型IEnumerable接口;2)实现泛型IEnumerable(T)接口。如果采用方法1,当集合元素T是值类型时,将涉及到巨多的boxing和unboxing操作。因此,理所当然地采用方法2;例如,以下代码采用方法2实现枚举从指定偏移开始所有整数using System.Collections.Generic;class Ints : IEnumerable { private readonly int offset; public Ints(int o) { offset = o; } public I... 阅读全文
posted @ 2013-07-25 17:08 protorock 阅读(1574) 评论(0) 推荐(0)
摘要:部署或安装系统服务时需要指定服务运行的账户。一般地,可选择Local System、Local Service或Network Service账户。Local System/Local Service/Network Service账户的区别在于每个账户的权限(Rights)不同。在Windows 2003和Windows XP之前,Service几乎都是运行在Local System账户下;从Windows 2003和WindowsXP开始,系统增加了Local Service和 Network Service账户。为什么要增加这两个新的内置账户?如何为Service选择账户?在回答这两个问 阅读全文
posted @ 2013-07-14 15:48 protorock 阅读(2924) 评论(0) 推荐(0)