一个计数器类

    public class Counter
    {
        
private static UInt32 _counter = 0;
        
public static UInt32 Next
        {
            
get
            {
                
if (_counter == 99999999) { _counter = 0; }
                _counter
++;
                
string _prenum = DateTime.Now.ToString("dd");
                
string ret = _prenum + _counter.ToString("00000000");
                
return Convert.ToUInt32(ret);
            }
        }
        
public static void Reset()
        {
            _counter 
= 0;
        }
    }
posted @ 2009-07-23 11:16  Aricc  阅读(190)  评论(0编辑  收藏  举报