Advertisement
agentsix1

I HATE YOU VB.NET

Apr 29th, 2017
38,365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.94 KB | None | 0 0
  1. Public selected As Integer = -1
  2.  
  3.     Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
  4.         If (System.IO.File.Exists(appPath & "files\" & song_filename(selected))) Then
  5.             If ComboBox1.Text = "" Then
  6.                 MsgBox("You need to select a audio file that you would like to restore.")
  7.             Else
  8.                 System.IO.File.Copy(appPath & "files\" & song_filename(selected), gmod & song_detail(selected), True)
  9.                 MsgBox("Done!")
  10.             End If
  11.         Else
  12.             If ComboBox1.Text = "" Then
  13.                 MsgBox("You need to select a audio file that you would like to restore.")
  14.             Else
  15.                 Dim sound_loc = ""
  16.                 For Each pre As String In Split(sound_list_database, vbCrLf)
  17.                     Dim sound() = Split(pre, "|")
  18.                     Dim files() = Split(My.Settings.audio_files_filename, "!=!")
  19.                     MsgBox(sound(0) & files(selected).ToString & selected)
  20.                     If (sound(0).Equals(files(selected))) Then
  21.                         Dim out = MsgBox("It appears you have not already downloaded the file for this sound. Would you like to download the sound now to continue this process?", vbYesNo, "No file")
  22.                         If out = DialogResult.Yes Then
  23.                             My.Computer.Network.DownloadFile(sound(1), appPath & "files\" & files(selected))
  24.                             System.IO.File.Copy(appPath & "files\" & files(selected), gmod & song_detail(selected), True)
  25.                             MsgBox("Done!")
  26.                             Exit For
  27.                         End If
  28.                     End If
  29.                 Next
  30.  
  31.             End If
  32.         End If
  33.     End Sub
  34.  
  35. Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
  36.         selected = ComboBox1.SelectedIndex
  37.         MsgBox(selected)
  38.  
  39.  
  40.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement