美文网首页
关于.Net core 开发项目时遇到的一些问题及解决方案

关于.Net core 开发项目时遇到的一些问题及解决方案

作者: UtopiaLee | 来源:发表于2021-07-20 09:34 被阅读0次

.Net core 从json文件中去取json数组中的对象

var res = _config.GetSection("doors").GetChildren().Select(x=>new {
doorName=x.GetValue<string>("doorName"),
controllerIP = x.GetValue<string>("controllerIP"),
port = x.GetValue<string>("port"),
SN = x.GetValue<string>("SN"),
channel = x.GetValue<string>("channel"),
}).ToList();

用MemoryStream 返回文件流的时候,流的起始位置一定要置为0

MemoryStream ms = new MemoryStream();
ms.Seek(0, SeekOrigin.Begin);
workbook.Write(ms);
ms.Position = 0;

相关文章

网友评论

      本文标题:关于.Net core 开发项目时遇到的一些问题及解决方案

      本文链接:https://www.haomeiwen.com/subject/vkslmltx.html