繁体   English   中英

在Windows Core IOT中创建和使用资源

[英]Creating and using resources within Windows Core IOT

我正在Raspberry Pi上构建Windows Core IOT后台任务应用程序,我需要存储一些文本资源文件(html,css,js)以通过tcp套接字连接提供服务。

麻烦的是,我正在努力寻找最简单的方法来将这些文件的文件夹作为嵌入式资源,可以从已构建的Web服务器访问这些资源。

任何建议都会很好。

我似乎无权访问Properties命名空间。

将文件包含到您的项目中,并使用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");
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM