Skip to content

Instantly share code, notes, and snippets.

@keir-nellyer
Created September 5, 2014 17:30
Show Gist options
  • Save keir-nellyer/f159657271d438e29b8e to your computer and use it in GitHub Desktop.
Save keir-nellyer/f159657271d438e29b8e to your computer and use it in GitHub Desktop.
Fun in Computing
Dim random As Random = New Random
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Dim amount As Integer = InputBox("How many times?")
Dim index As Integer = 0
Do While index < amount
Dim systemSound As Media.SystemSound
Dim i As Integer = random.Next(0, 5)
If i = 0 Then
systemSound = Media.SystemSounds.Question
ElseIf i = 1 Then
systemSound = Media.SystemSounds.Asterisk
ElseIf i = 2 Then
systemSound = Media.SystemSounds.Beep
ElseIf i = 3 Then
systemSound = Media.SystemSounds.Exclamation
Else
systemSound = Media.SystemSounds.Hand
End If
systemSound.Play()
index += 1
Threading.Thread.Sleep(random.Next(50, 500))
Loop
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
MsgBox("You were warned!")
Dim processes As List(Of String) = New List(Of String)
processes.Add("http://en.wikipedia.org/wiki/Illuminati")
processes.Add("http://google.com")
processes.Add("calc.exe")
processes.Add("cmd.exe")
processes.Add("notepad.exe")
processes.Add("magnify.exe")
processes.Add("narrator.exe")
processes.Add("taskmgr.exe")
processes.Add("mspaint.exe")
processes.Add("charmap.exe")
Dim index As Integer = 0
Do While index < 20
System.Diagnostics.Process.Start(processes(random.Next(processes.Count)))
index += 1
Loop
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment