Public Class Form1
Dim r As New Random
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim RandomNumber As Integer = r.Next(0, 6) 'Generates Random Number between 0-6
Select Case RandomNumber
Case 0
Process.Start("My File")
Playing Random Video/Music file within folder.
Page 1 of 12 Replies - 168 Views - Last Post: 25 November 2012 - 09:14 PM
#1
Playing Random Video/Music file within folder.
Posted 25 November 2012 - 01:48 PM
Hi there do you know if it's possible to play a random video/music file within a folder which is familiar to the random number function. Currently at the moment I have it setup like this
Replies To: Playing Random Video/Music file within folder.
#2
Re: Playing Random Video/Music file within folder.
Posted 25 November 2012 - 02:04 PM
This wasn't meant to be posted
. If any one can delete this that would be great, unless of course I can delete it(but couldn't find how to)
#3
Re: Playing Random Video/Music file within folder.
Posted 25 November 2012 - 09:14 PM
TomPolar, on 25 November 2012 - 02:48 PM, said:
Hi there do you know if it's possible to play a random video/music file within a folder which is familiar to the random number function. Currently at the moment I have it setup like this
Get the directory contents as strings, filter for file type, add the contents to an array or List(of T), then generate a random index between 0 and .Count-1, and do a Process.Start(ArrayName(index)).
You'll want to know when the the music stops playing, if you want to carry on with more songs. Check the other members of the Process class.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|