المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : getfilename



C# Programming
09-19-2009, 04:11 AM
Hi
i have a simple window form with a listbox that plays a highlighted mp3, works great if i add the mp3 to the project bin, however when i try and put a path in for mp3 for example f:\mp3\song.mp3 it says it "cant play file "

if i put a copy of the mp3 (song.mp3) in the project bin but leave the path as f:\mp3\song.mp3 then it plays fine

so i'm guessing it is defaulting to the project bin to get filename, what am i missing?

code:

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{

dsAudioPlayer1.FileName = Path.GetFileName(listBox1.SelectedItem.ToString ());

kenny