问题
i want to use a listbox in my wp7 app where i want to display the names of all the files present in a specific directory. i have added the folder with all files in my project itself. i want to populate all the file names in that folder. how can i access it? i am using this to bindlist
string[] files = Directory.GetFiles("C:\\Users\\sony\\Documents\\Visual Studio 2010\\Projects\\MyChristmas\\MyChristmas\\recipe");
foreach (string f in files)
{
string entry1 = System.IO.Path.GetFullPath(f);
string entry = System.IO.Path.GetFileName(f);
listBox1.Items.Add(entry);
}
it may be very basic but i am a student and am learning it all on my own so please help.
来源:https://stackoverflow.com/questions/13824721/how-to-populate-a-listbox-with-files-in-the-project-of-my-windows-phone-7-applic