1. 程式人生 > >隨機算法

隨機算法

string ret oms see ext lis and static tran

        static void Test7()
        {
            var strs = new List<string>
            {
                "192.168.100.125",
                "192.168.100.126",
                "192.168.100.127",
                "192.168.100.128",
                "192.168.100.130",
                "192.168.100.131
" }; var d = GetRandom(strs); } public static T GetRandom<T>(List<T> list) { System.Random ran = new System.Random(GetRandomSeed()); var t = ran.Next(0, list.Count); return list[t]; }

隨機算法