{"id":684,"date":"2017-01-17T11:20:34","date_gmt":"2017-01-17T11:20:34","guid":{"rendered":"https:\/\/ibex.tech\/windows-iot\/?p=426"},"modified":"2022-09-13T15:38:22","modified_gmt":"2022-09-13T14:38:22","slug":"assets","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/files\/assets","title":{"rendered":"Assets"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Adding files to assets<\/h4>\n\n\n\n<p>You need to right click the Assets folder in Visual Studio and select Add existing item (you can&#8217;t just copy files into the folder in explorer)<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Files That Were Packaged With Your App (Assets)<br><\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\tWindows.Storage.StorageFolder folder = Windows.ApplicationModel.Package.Current.InstalledLocation;\n\tWindows.Storage.StorageFile file = await folder.GetFileAsync(\"Assets\\\\SomeFile.txt\");<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\t&lt;MediaElement Name=\"audioplayer1\" AutoPlay=\"False\" Source = \"Assets\/audio_song.mp3\" \/&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Adding files to assets You need to right click the Assets folder in Visual Studio and select Add existing item (you can&#8217;t just copy files into the folder in explorer) Files That Were Packaged With Your App (Assets)<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[135],"tags":[],"class_list":["post-684","post","type-post","status-publish","format-standard","hentry","category-files"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=684"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/684\/revisions"}],"predecessor-version":[{"id":1183,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/684\/revisions\/1183"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}