我有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