Click here to Skip to main content
15,897,891 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionUpdate using DetailsView and DataSource Pin
Patricker29-Aug-06 10:13
Patricker29-Aug-06 10:13 
QuestionStream dataset to the browser as RSS Pin
Brent Lamborn29-Aug-06 10:10
Brent Lamborn29-Aug-06 10:10 
QuestionWeb service Pin
kjosh29-Aug-06 7:48
kjosh29-Aug-06 7:48 
QuestionWebservice returning Dataset Pin
kjosh29-Aug-06 7:44
kjosh29-Aug-06 7:44 
AnswerRe: Webservice returning Dataset Pin
ToddHileHoffer29-Aug-06 8:28
ToddHileHoffer29-Aug-06 8:28 
AnswerRe: Webservice returning Dataset Pin
kjosh29-Aug-06 15:30
kjosh29-Aug-06 15:30 
GeneralRe: Webservice returning Dataset Pin
ToddHileHoffer30-Aug-06 2:43
ToddHileHoffer30-Aug-06 2:43 
QuestionDisplay random image form folder. Pin
munklefish29-Aug-06 6:38
munklefish29-Aug-06 6:38 
Hi,

Can anyone help me with a problem. I need to display a random image each time a page is loaded. The project is to be created using c# and asp.Net 2.0.

However i need the random image to be displayed from a given directory rather than from url's placed in a database.

If anyone can offer any help i'd really appreciate it. So far ive only managed to find the following code, but this doesnt help as my server does not have the 'FULL' or 'High' trust level required for the server to run this script.

Random r = new Random();<br />
<br />
       System.IO.DirectoryInfo d = new System.IO.DirectoryInfo(@"D:\inetpub\communityfoundation\images\leftofpage\");<br />
        System.IO.FileInfo[] fi = d.GetFiles();<br />
<br />
        int file = r.Next(fi.GetLength(0));<br />
        string FIleName = fi[file].FullName;<br />
<br />
        Image1.ImageUrl = FIleName;


Thanks!
AnswerRe: Display random image form folder. Pin
ToddHileHoffer29-Aug-06 6:48
ToddHileHoffer29-Aug-06 6:48 
GeneralRe: Display random image form folder. Pin
munklefish29-Aug-06 6:57
munklefish29-Aug-06 6:57 
GeneralRe: Display random image form folder. Pin
ToddHileHoffer29-Aug-06 8:26
ToddHileHoffer29-Aug-06 8:26 
QuestionAdd/Delete Record Pin
shapper29-Aug-06 6:24
shapper29-Aug-06 6:24 
AnswerRe: Add/Delete Record Pin
ToddHileHoffer29-Aug-06 6:43
ToddHileHoffer29-Aug-06 6:43 
GeneralRe: Add/Delete Record Pin
shapper29-Aug-06 11:02
shapper29-Aug-06 11:02 
GeneralRe: Add/Delete Record Pin
eggsovereasy30-Aug-06 3:29
eggsovereasy30-Aug-06 3:29 
AnswerRe: Add/Delete Record Pin
YeHtut29-Aug-06 20:24
YeHtut29-Aug-06 20:24 
QuestionForms Authentication and Crystalreportviewer.ReportSource Pin
vonny23229-Aug-06 5:46
vonny23229-Aug-06 5:46 
QuestionDatasets all over again Pin
drc_no129-Aug-06 4:56
drc_no129-Aug-06 4:56 
Questiondelete file from drive Pin
playout29-Aug-06 3:51
playout29-Aug-06 3:51 
AnswerRe: delete file from drive Pin
ToddHileHoffer29-Aug-06 4:12
ToddHileHoffer29-Aug-06 4:12 
GeneralRe: delete file from drive Pin
playout29-Aug-06 4:31
playout29-Aug-06 4:31 
GeneralRe: delete file from drive Pin
ToddHileHoffer29-Aug-06 4:32
ToddHileHoffer29-Aug-06 4:32 
GeneralRe: delete file from drive Pin
Baj2229-Aug-06 5:24
Baj2229-Aug-06 5:24 
GeneralRe: delete file from drive Pin
ToddHileHoffer29-Aug-06 6:21
ToddHileHoffer29-Aug-06 6:21 
QuestionFormatting the Data Display asp.net 2.0 Pin
Jay_se29-Aug-06 3:26
Jay_se29-Aug-06 3:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.