displaying images randomly

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
 
K

Kevin Spencer

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
 
B

Blasting Cap

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.
 
K

Kevin Spencer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top