Posted on: 9/26/2013 7:40:51 PM | Views : 244

I am trying to change array of images using regular expressions.Here is the code..
case "CHANGE IMAGE": var ImageNames = new List<string> { "img01.jpg", "img02.jpg", "img03.jpg", "img04.jpg" }; Random randonGeni = new Random(); int indexi = randonGeni.Next(ImageNames.Count); var ImageName = ImageNames[indexi]; ImageNames.RemoveAt(indexi); var imageContents = System.IO.File.ReadAllText(@"C:\SchoolSite\default.css"); imageContents = Regex.Replace(imageContents, @"#banner-wrapper \{background: url(images/[^\}]+)\} no repeat top center", "#banner-wrapper {background: url(images/" + ImageName + ") no-repeat top center;}"); System.IO.File.WriteAllText(@"C:\SchoolSite\default.css", imageContents); break; Could you please help me out in changing the images.

< ...

Go to the complete details ...