关于.Net core 开发项目时遇到的一些问题及解决方案
本文最后更新于 2023-10-18,文章内容可能已经过时。
关于.Net core 开发项目时遇到的一些问题及解决方案
.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;
©著作权归作者所有,转载或内容合作请联系作者
本文是转载文章,版权归原作者所有。建议访问原文,转载本文请联系原作者。
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果