how to populate a listbox with files in the project of my windows phone 7 application

非 Y 不嫁゛ 提交于 2019-12-02 10:27:01

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!