2015-06-18 35 views
1

我在Raspberry Pi上構建了Windows Core IOT後臺任務應用程序,並且需要存儲一些文本資源文件(html,css,js)以通過tcp套接字連接進行服務。在Windows Core內創建和使用資源IOT

問題是我努力尋找最簡單的方法來將這些文件的文件夾作爲嵌入式資源,我可以從我已經構建的網絡服務器訪問這些文件。

任何建議都會很好。

我似乎無法訪問屬性命名空間。

回答

0

將文件包含到您的項目中並使用InstalledLocation文件夾訪問它們。

如果,例如,你有一個在你的項目結構命名爲「HTML」的文件夾,訪問這樣的文件:

async void ExampleFunc() 
{ 
    // get the StorageFolder 
    var WebRoot = await Package.Current.InstalledLocation.GetFolderAsync("html"); 
    // load the file (StorageFile) 
    var file = await WebRoot.GetFileAsync("index.html"); 
}