我有Windows Phone 8应用程序,其中我想包括我自己的10个MP3。我将之列入/资产,但像哪里是我的静态内容在Windows Phone 8应用程序?
通话using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
songs = store.GetFileNames("*.mp3").ToList();
Console.WriteLine("Found {0} files ", songs.Count());
}
保持返回该MP3音乐在我的商店#0
我试图把MP3歌曲的内涵,资产,资源和设定一直拷贝选项,但无济于事。
任何帮助将不胜感激。
可能重复[如何从项目文件夹读取文件?(http://stackoverflow.com/问题/ 6531968 /如何读取文件从项目文件夹) – MarcinJuraszek 2013-02-26 20:57:33
感谢指出,但我不能得到那个工作..这里是我使用的示例代码:string resourcePath = @“/ PhoneApp1; component /资源/“;装配组件= Assembly.GetExecutingAssembly(); string [] resources = assembly.GetManifestResourceNames(); 列表 files = new List (); 的foreach(在resourcePath字符串资源) { 如果(resource.EndsWith( “MP3”)){ // } } 我 –
techtinkerer
2013-02-26 22:48:17