Ejemplo n.º 1
0
        private string BuildRandomImageLinkFor(string imageHandle)
        {
            DirectoryInfo di = new DirectoryInfo(Path.Join(Constants.WorkingDirectory, imagesDirectory, imageHandle));

            FileInfo[] files  = di.GetFiles();
            Random     rand   = new Random();
            int        chosen = rand.Next(0, files.Length - 1);

            return($"http://{Constants.BaseAddress}/{imagesDirectory}/{imageHandle}/{files[chosen].Name}" + ParameterUtils.GenerateUniqueParam());
        }