SpotifyAPI-NET
SpotifyAPI-NET copied to clipboard
Now SpotifyLocalAPI.RunSpotify() doesn't run on Windows 10.
Now SpotifyLocalAPI.RunSpotify() doesn't run on Windows 10. Anyone have this behavior too?
All RunSpotify() does is find the spotify.exe and run it.
It doesn't work anymore because IsSpotifyRunning() can't retrieve the correct value. I recommend removing the LocalAPI from your progam entirely, you can use this function to start spotify instead:
using System.IO;
public void RunSpotify()
{
Process[] pName = Process.GetProcessesByName("spotify");
if (pName.Length != 0)
{
return; // A process with the name "spotify" is already running
}
if (File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"spotify\spotify.exe")))
Process.Start(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"spotify\spotify.exe"));
}