Sixem

.NET Get Current Song In Spotify

Jun 29th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.70 KB | None | 0 0
  1.         Try
  2.             Dim Title_Trim As String = Nothing
  3.             Dim p() As Process = Process.GetProcessesByName("spotify")
  4.             For Each proc As Process In p
  5.                 Dim Temp_Cur As String = CStr(proc.MainWindowTitle)
  6.                 If CStr(Regex.Split(Temp_Cur, "Spotify - ").GetValue(1)).Length > 5 Then
  7.                     Title_Trim = CStr(Regex.Split(Temp_Cur, "Spotify - ").GetValue(1))
  8.                     Spotify_Arist = Regex.Split(Title_Trim, " – ").GetValue(0)
  9.                     Spotify_Title = Regex.Split(Title_Trim, " – ").GetValue(1)
  10.                 End If
  11.             Next
  12.         Catch ex As Exception
  13.             Messagebox.Show(ex.message)
  14.         End Try
Advertisement
Add Comment
Please, Sign In to add comment