05 2014 档案
摘要:假设有A、B两个类,他们的成员完全相同,在给对象A设完值后,想让对象B也像A一样,有设置过的值,此时可用ValueInjecter来解决。代码:using System;using System.Collections.Generic;using System.Text;using Omu.Valu...
阅读全文
摘要:class Program { delegate bool Foo(int n); static bool foo1(int n) { return true; } static bool foo2(int n) { return n...
阅读全文
摘要:看了官方的、网上其他的,写了2个demo,只不过还是没发现哪里会用到。IEnumerable和IEnumerator都是System.Collections下的接口,结构分别如下:namespace System.Collections{ public interface IEnumerabl...
阅读全文
摘要:static void Main(string[] args) { //输出:2 4 8 16 32 64 128 256 foreach (int i in Power(2, 8)) { ...
阅读全文
摘要:一、System.Timers.Timer并不是调用Start方法就执行,而是在过了设定的周期再调用Start才执行(System.Windows.Forms.Timer也一样)。获取或设置一个值,该值指示 Timer 是应在每次指定的间隔结束时引发 Elapsed 事件,还是仅在指定的间隔第一次结...
阅读全文
摘要:#region 调用timer控件实时查询开关机时间private void timer1_Tick(object sender, EventArgs e){ string sql = "SELECT startTime,endTime,AMTusername,AMTpassword,AMTi...
阅读全文