示例#1
0
        public Network.Host GetRandomHost()
        {
            String FileContents = File.Reader.ReadAll(InitialHostsFile);

            String[] AllHosts = Util.StringUtils.SplitNewLines(FileContents);

            if (Generator == null)
            {
                Generator = new Util.SimpleRandom();
            }



            String SelectedHost = Util.StringUtils.PickRandom(AllHosts, Generator);

            return(new Network.Host(SelectedHost));
        }
示例#2
0
 public InitialHosts(String File, Util.IRandomGenerator Random)
 {
     InitialHostsFile = File;
     Generator        = Random;
 }