displaying images randomly

Discussion in 'ASP .Net' started by Blasting Cap, Jul 2, 2007.

  1. Blasting Cap

    Blasting Cap Guest

    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
     
    Blasting Cap, Jul 2, 2007
    #1
    1. Advertisements

  2. 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
     
    Kevin Spencer, Jul 2, 2007
    #2
    1. Advertisements

  3. Blasting Cap

    Blasting Cap Guest

    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.
     
    Blasting Cap, Jul 2, 2007
    #3
  4. 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
     
    Kevin Spencer, Jul 2, 2007
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.