学习随记

1.Lambda
    Invoke(new Action<object>(o=>{/*方法体*/}));

2.Debug&Track
    .Assert(), .WriteLine()+DbgView

3.HashTable之类键值集合,直接使用 coll.Values 遍历

4.Socket服务器主动侦测掉线
    Socket sock = new Socket(AddressFamily.InterNetwork,SocketType.Stream, ProtocolType.Tcp);
    int keepAlive = -1744830460; // SIO_KEEPALIVE_VALS
    byte[] inValue = new byte[] { 1, 0, 0, 0, 0x10, 0x27, 0, 0, 0xe8, 0x03, 0, 0 }; // True, 10秒, 1 秒
    sock.IOControl(keepAlive, inValue, null);

5.List初始化的时候分配一个值

posted @ 2013-04-06 04:03  Hanf  阅读(266)  评论(0编辑  收藏  举报
Copyright © 2008-2016 Hanf All Rights Reserved