代码人生

public bool Success
{
    get
    {
        Console.WriteLine("start");
        var chance = new Random(DateTime.Now.GetHashCode());
        while (chance.Next(1000000000) != 0)
        {
            //Console.WriteLine("give up");
           
//return false;
        }
        Console.WriteLine("success");
        return true;
    }
}

 

------ Test started: Assembly: CodeLife.exe ------

 

start
success
True

 

1 passed, 0 failed, 0 skipped, took 16.04 seconds (Ad hoc).

posted @ 2010-09-18 00:40  neutra  阅读(268)  评论(0编辑  收藏  举报