Random Image. Hit [F5] to refresh for another image

A simple file randomer

Posted on January 31, 2008 14:32 by vincentpang

The idea is to have a simple image random at minimum processing power of course (like the one on top of the header in my blog) 

The objectives

1) support multiple folders
2) randomly get an image in the specified folder
3) hide the source of the image (bonus) 

How to call the function is like this 

<img src="/blog/imgRandom.aspx?p=1">

in which p is the path and is defined in GetPath(). You can have as many directory as possible and it will randomly pick an image.

Known problem,

for some reason the searchPattern only take in 1 parameter. Meaning only search *.jpg but cannot support *.jpg or *.gif

Attachment: imgRandom.zip (950.00 bytes) (C#)

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading




Shoutout


Free shoutbox @ ShoutMix

Ads

Tags