Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string[] GetSpotifyInfo()
- {
- if (Processrunning("spotify"))
- {
- string[] info = { "1", "2" };
- foreach (Process proc in Process.GetProcesses())
- {
- if (proc.MainWindowTitle.StartsWith("Spotify - "))
- {
- string[] sang = proc.MainWindowTitle.Split('-');
- string[] lines = Regex.Split(sang[1], "–");
- return lines;
- }
- else if (proc.MainWindowTitle == "Spotify")
- {
- string[] nodata = { "No song" };
- return nodata;
- }
- }
- return info;
- }
- else
- {
- string[] hei = { "No data" };
- return hei;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement