displaying images randomly

  • Thread starter Thread starter Blasting Cap
  • Start date Start date
B

Blasting Cap

On a web page (the default page of my app), I want to grab some shots
off another of our websites (pictures of products that are already
thumbnailed) for display on my page.

I've found some examples of where they are doing it with a file share,
but not via a URL.

There are about 50-75 images on that URL, all named various things, the
only constant is that the first 2 characters of the image name will be
"TN". I'd like to display 3 random images from that URL, but not of the
same item.

Using ASP.Net framework 2.0, visual studio 2005. Server is Windows 2003.

Any help/advice/suggestions appreciated.

Thanks,

BC
 
Use an HttpWebRequest to get the HTML of the page. Then use a regular
expression to find the image tags in the HTML, and specifically the URLs in
those tags. Create an array of strings having those URLs. Then generate a
random number between 0 and the array length - 1 to fetch a URL from the
array.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
Could the adrotator control be used to do this?

I know that I don't need the navigate url part of it, but could use the
image url part of it.
 
I have no idea.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
Back
Top