I have a web form in which i have requirement to browse an audio file using file upload control,and then a button to upload and play this file to folder on the server,from there i get the path to it soundplayer,My problem is that when i pass path in this way its work fineHide Copy Code
SoundPlayer playthewavfile = new SoundPlayer(@"G:\backup\LTM.CTP.WEBFORM\LTM.CTP.WEBFORM\Audio\q1.wav");
but i want to give the path like thisHide Copy Code
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Forms/Upload/" + fileName)); string PATH = System.IO.Path.Combine(Server.MapPath("~/Forms/Upload"), FileUpload5.PostedFile.FileName); SoundPlayer playthewavfile = new SoundPlayer(PATH); playthewavfile.Play();
here its give exception of invalid path?