I have a sub that is supposed to play a music file. I can locate MyDocuments easily. I can even use Path.Combine to concatenate the rest of the string.
The full path should look something like this:
......Documents\JukeBox\MichaelJackson\01.wav
But I am getting double slashes not single ones
private static void playChoice(string band, int choice)
{
var myDocs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
string filename = "0" + choice;
string[] paths = { myDocs, "JukeBox", band, filename, ".wav" };
var fullPath = Path.Combine(@paths);
var player = new System.Media.SoundPlayer(fullPath);
player.Play();
}
A) How do I strip out the double slashes since my verbatim specifier does not work B) The code looks awful - is there a better approach - or does anyone have a link to helpful literature