当前位置: 首页 > news >正文

C#用Aspose.Cells导出Excel,.NET导出Excel

ASP.NET MVC 控制器里面Action处理,下载文件,输出文件流

   public async Task<ActionResult> ExportNewsAuthorFee(string deptId, DateTime? startDate, DateTime? endDate){if (startDate == null){startDate = DateTime.Parse(DateTime.Now.Year + "-1-1");}string title = startDate.Value.ToString("yyyy-MM-dd");if (endDate.HasValue){title += "至"+endDate.Value.ToString("yyyy-MM-dd");}var list = await newsStatiscBll.GetUserChannelRoyaltiesListAsync(deptId, startDate, endDate);List<List<string>> excelData = new List<List<string>>();//标题设置,第一行List<string> titleList = new List<string>();           titleList.Add("姓名");titleList.Add("员工编号");titleList.Add("部门");titleList.Add("院");titleList.Add("");titleList.Add("小计");titleList.Add("分");titleList.Add("");titleList.Add("");titleList.Add("小计");titleList.Add("门");titleList.Add("网");for (int q = 0; q < 6; q++){titleList.Add("");}titleList.Add("小计");titleList.Add("电视");titleList.Add("");titleList.Add("");titleList.Add("小计");titleList.Add("绿色1");titleList.Add("绿色2");titleList.Add("绿色3");titleList.Add("西1");titleList.Add("西2");titleList.Add("西3");titleList.Add("川3");titleList.Add("川4");titleList.Add("川5");titleList.Add("铁6");titleList.Add("铁7");titleList.Add("铁8");titleList.Add("省9");titleList.Add("省12");titleList.Add("省11");titleList.Add("小计");titleList.Add("总计");excelData.Add(titleList);//第二行List<string> titleList2 = new List<string>();titleList2.Add("");titleList2.Add("");titleList2.Add("");titleList2.Add("摄1");titleList2.Add("文2");titleList2.Add("");titleList2.Add("气1");titleList2.Add("川2");titleList2.Add("摄3");titleList2.Add("");titleList2.Add("");titleList2.Add("地简讯");titleList2.Add("地非简讯");titleList2.Add("省简讯");titleList2.Add("省非简讯");titleList2.Add("简讯1");titleList2.Add("非简讯2");titleList2.Add("国");titleList2.Add("");titleList2.Add("地市1");titleList2.Add("省部2");titleList2.Add("国家3");titleList2.Add("");for (int n = 0; n< 17; n++){titleList2.Add("");}excelData.Add(titleList2);//数据封装foreach (var item in list){List<string> cellDataList  = new List<string>();// 小计decimal xj_yw1 = item.FeeAnPhotography + item.FeeAnLiterary;// 小计decimal xj_fgs = item.FeeFmGasField + item.FeeFmChuanyouFigures + item.FeeFmPhotography;//报刊小计decimal xj_wl = item.FeeNewspapers_disShort+ item.FeeNewspapers_disImgTxt+ item.FeeNewspapers_provinceShort+ item.FeeNewspapers_provinceShort+ item.FeeNewspapers_nationalShort+ item.FeeNewspapers_nationalImgTxt+ item.FeeNewspapers_PetroChina;//电视新闻,小计decimal xj_tv = item.FeeTV_dis + item.FeeTV_province + item.FeeTV_national;//【小计】  decimal xj_mt2 = item.FeeGreen_author+ item.FeeGreen_edit+ item.FeeGreen_img+ item.FeeXi_author+ item.FeeXi_edit+ item.FeeXi_img+ item.FeeZChuanyouFigures_author+ item.FeeZChuanyFigures_edit+ item.FeeZChuanyouFigures_img+ item.FeeZIronMan_author+ item.FeeZIronMan_edit+ item.FeeZIronMan_img+ item.FeeZProvinNewMedia_author+ item.FeeZProvinNewMedia_edit+ item.FeeZProvinNewMedia_img;decimal total = xj_yw1 + xj_fgs + xj_wl + xj_tv + xj_mt2;cellDataList.Add(item.UserRealName); /* 姓名*/cellDataList.Add(item.UserNo); /* 员工编号*/cellDataList.Add(item.DeptName); /* 部门*/cellDataList.Add(item.FeeAnPhotography.ToString()); /*  作品*/cellDataList.Add(item.FeeAnLiterary.ToString()); /* 作品*/cellDataList.Add(xj_yw1.ToString()); /*  小计*/cellDataList.Add(item.FeeFmGasField.ToString()); /*  气田风采*/cellDataList.Add(item.FeeFmChuanyouFigures.ToString()); /*  川油人物*/cellDataList.Add(item.FeeFmPhotography.ToString()); /*  摄影作品*/cellDataList.Add(xj_fgs.ToString()); /*  小计 */cellDataList.Add(item.FeeGpHome.ToString()); /*  门户  */cellDataList.Add(item.FeeNewspapers_disShort.ToString()); /*   刊_简讯*/cellDataList.Add(item.FeeNewspapers_disImgTxt.ToString()); /*  报刊_非简讯 */cellDataList.Add(item.FeeNewspapers_provinceShort.ToString()); /*  报刊_简讯 */cellDataList.Add(item.FeeNewspapers_provinceImgTxt.ToString()); /*  报刊_非简讯 */cellDataList.Add(item.FeeNewspapers_nationalShort.ToString()); /*  报刊_简讯 */cellDataList.Add(item.FeeNewspapers_nationalImgTxt.ToString()); /*  报刊_非简讯 */cellDataList.Add(item.FeeNewspapers_PetroChina.ToString()); /* 油*/cellDataList.Add(xj_wl.ToString()); /* 报刊小记 *///地cellDataList.Add(item.FeeTV_dis.ToString()); /* 地市级 */cellDataList.Add(item.FeeTV_province.ToString()); cellDataList.Add(item.FeeTV_national.ToString());cellDataList.Add(xj_tv.ToString()); /* 报刊小记 *///绿色cellDataList.Add(item.FeeGreen_author.ToString());cellDataList.Add(item.FeeGreen_edit.ToString());cellDataList.Add(item.FeeGreen_img.ToString());//西cellDataList.Add(item.FeeXi_author.ToString());cellDataList.Add(item.FeeXi_edit.ToString());cellDataList.Add(item.FeeXi_img.ToString());//川cellDataList.Add(item.FeeZChuanyouFigures_author.ToString());cellDataList.Add(item.FeeZChuanyFigures_edit.ToString());cellDataList.Add(item.FeeZChuanyouFigures_img.ToString());//铁cellDataList.Add(item.FeeZIronMan_author.ToString());cellDataList.Add(item.FeeZIronMan_edit.ToString());cellDataList.Add(item.FeeZIronMan_img.ToString());//省cellDataList.Add(item.FeeZProvinNewMedia_author.ToString());cellDataList.Add(item.FeeZProvinNewMedia_edit.ToString());cellDataList.Add(item.FeeZProvinNewMedia_img.ToString());cellDataList.Add(xj_mt2.ToString()); /*  小计 */cellDataList.Add(total.ToString()); /*  总计 */excelData.Add(cellDataList);}//单元格设置合并,标题第1行Action<Worksheet> ac = sheet =>{    sheet.Cells.Merge(0, 0, 2, 1); /*姓名,单元格合并*/sheet.Cells.Merge(0, 1, 2, 1); /*员工编号,单元格合并*/sheet.Cells.Merge(0, 2, 2, 1); /*部门,单元格合并*/sheet.Cells.Merge(0, 3, 1, 2); /*院网员工天地,单元格合并*/sheet.Cells.Merge(0, 5, 2, 1);/*小计,单元格合并*/sheet.Cells.Merge(0, 6, 1, 3);/*分公司门户,单元格合并*/sheet.Cells.Merge(0, 9,2, 1);/*小计,单元格合并*/sheet.Cells.Merge(0, 10,2, 1);/*集,单元格合并*/sheet.Cells.Merge(0, 11,1, 7);/*网,单元格合并*/sheet.Cells.Merge(0, 18,2,1);/*网,单元格合并*/sheet.Cells.Merge(0, 19,1,3);/*电,单元格合并*/sheet.Cells.Merge(0, 22,2,1);/*电,单元格合并*/sheet.Cells.Merge(0, 23,2,1);/*绿色,单元格合并*/for (int i = 24; i < 40; i++) {sheet.Cells.Merge(0, i, 2, 1);/* 单元格合并*/}};Stream stream = new MemoryStream();Export.ExportExcelHelpter.ExportAuthorExcelBig(excelData, ref stream, ac, null);string fileName = "作者稿费统计(" + title + ")" + Guid.NewGuid().ToString("N").Substring(0,4) + ".xlsx";return File(stream, "application/ocelet-stream", fileName);}

处理导出

using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Threading.Tasks;
using Aspose.Cells;/// <summary>
/// 导出Excel,ac传入委托设置Cells格式,比如合并;比如单元格宽度设置等。
/// </summary>
/// <param name="data">数据</param> 
/// <param name="stream"></param>
/// <param name="stream">委托,设置Cells格式,比如合并;比如单元格宽度设置等</param>
/// <param name="afterAc">委托,数据已经插入后,设置单元格样式,比如列宽、列高配置</param>
/// 创建时间:2024-7-25 17:41:56, xxx
public static void ExportAuthorExcelBig(List<List<string>> data , ref Stream stream, Action<Worksheet> ac, Action<Cells> afterAc)
{Workbook wb = new Workbook();Worksheet sheet = wb.Worksheets[0];sheet.Name = "作者统计分析";Cells cells = sheet.Cells;Style style = wb.Styles[wb.Styles.Add()];style.Font.Size = 12;cells.ApplyStyle(style, new StyleFlag() { All = true });int cols = data[0].Count;//int cols = colsCount;//标题样式Style styleTitle = wb.Styles[wb.Styles.Add()];styleTitle.Font.IsBold = true;styleTitle.Font.Size = 12;//styleTitle.Font.Color = Color.Blue;/* 字体颜色*/styleTitle.ForegroundColor = Color.SpringGreen;/* 背景色 */styleTitle.Pattern = BackgroundType.Solid;/* 背景色 *///边框设置styleTitle.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thin;styleTitle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;styleTitle.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.Thin;styleTitle.Borders[BorderType.RightBorder].LineStyle = CellBorderType.Thin;//styleTitle.Borders.SetStyle(CellBorderType.Thick);/*单元格边框有线,中间被叉叉封起*/styleTitle.HorizontalAlignment = TextAlignmentType.Center;styleTitle.VerticalAlignment = TextAlignmentType.Center;Range range = cells.CreateRange(0, 0, 2, cols);range.ApplyStyle(styleTitle, new StyleFlag() { All = true });#region 合并表头单元格//调用传入委托,ac?.Invoke(sheet);第一行//sheet.Cells.Merge(0, 0, 3, 1);//合并第一行第一列开始 合并3行1列//sheet.Cells.Merge(0, 1, 3, 1);//sheet.Cells.Merge(0, 2, 3, 1);//sheet.Cells.Merge(0, 3, 3, 1);//sheet.Cells.Merge(0, 4, 3, 1);//sheet.Cells.Merge(0, 5, 3, 1);//sheet.Cells.Merge(0, 6, 1, 64);第二行//sheet.Cells.Merge(1, 6, 1, 4);//sheet.Cells.Merge(1, 10, 1, 4);//sheet.Cells.Merge(1, 14, 1, 4);//sheet.Cells.Merge(1, 18, 1, 4);//sheet.Cells.Merge(1, 22, 1, 4);//sheet.Cells.Merge(1, 26, 1, 4);//sheet.Cells.Merge(1, 30, 1, 4);//sheet.Cells.Merge(1, 34, 1, 4);//sheet.Cells.Merge(1, 38, 1, 4);//sheet.Cells.Merge(1, 42, 1, 4);//sheet.Cells.Merge(1, 46, 1, 4);//sheet.Cells.Merge(1, 50, 1, 4);//sheet.Cells.Merge(1, 54, 1, 4);//sheet.Cells.Merge(1, 58, 1, 4);//sheet.Cells.Merge(1, 62, 1, 4);//sheet.Cells.Merge(1, 66, 1, 4);#endregionobject[,] dataArr2 = new object[data.Count, cols];for (int n = 0; n < data.Count; n++){var rowLine = data[n];for (int j = 0; j < rowLine.Count; j++){dataArr2[n, j] = rowLine[j];}}cells.ImportTwoDimensionArray(dataArr2, 0, 0);//自适应宽sheet.AutoFitColumns();//自适应行高sheet.AutoFitRows();//cells.SetRowHeight(0, 20);//cells.SetRowHeight(1, 20);//cells.SetRowHeight(2, 20);//for (int i = 0; i < cols; i++)//{//    cells.SetColumnWidth(i, 15);//}afterAc?.Invoke(cells);//输出文件流          stream.Seek(0, SeekOrigin.Begin);wb.Save(stream, SaveFormat.Xlsx);stream.Seek(0, SeekOrigin.Begin);//保存文件到本地    //string fileName = Guid.NewGuid().ToString("N") + ".xls";//string filePath = AppDomain.CurrentDomain.BaseDirectory + fileName;//string fileFolderDeire = Path.GetDirectoryName(filePath);//目录信息//if (!Directory.Exists(fileFolderDeire))//{//    Directory.CreateDirectory(fileFolderDeire);//}   //如果是大文件,建议返回文件磁盘路径//wb.Save(filePath);//stream = new FileStream(filePath, FileMode.Open);//Task.Run(() =>//{//    //删除生成的文件//    System.Threading.Thread.Sleep(60000);//    try//    {//        File.Delete(filePath);//    }//    catch (Exception) { }//});
}

相关文章:

C#用Aspose.Cells导出Excel,.NET导出Excel

ASP.NET MVC 控制器里面Action处理&#xff0c;下载文件&#xff0c;输出文件流 public async Task<ActionResult> ExportNewsAuthorFee(string deptId, DateTime? startDate, DateTime? endDate){if (startDate null){startDate DateTime.Parse(DateTime.Now.Year …...

天猫番茄品类TOP1,复购率超40%,「一颗大」如何策划极致产品力?

桔子要买什么品牌&#xff1f;桃子买什么品牌&#xff1f;土豆买什么品牌&#xff1f;过去人们购买农产品几乎没有品牌意识。但近年来可能某些人买猕猴桃时会考虑佳沛&#xff0c;这是一个在全球达到30%猕猴桃市场的新西兰品牌。与此类似&#xff0c;一个国产品牌「一颗大™」正…...

Docker搭建私有仓库harbor(docker 镜像仓库搭建)

Harbor介绍 Docker容器应用的开发和运行离不开可靠的镜像管理&#xff0c;虽然Docker官方也提供了公共的镜像仓库&#xff0c;但是从安全和效率等方面考虑&#xff0c;部署我们私有环境内的Registry也是非常必要的。Harbor是由VMware公司开源的企业级的Docker Registry管理项目…...

面试题:MySQL 索引

1. 谈一下你对于MySQL索引的理解?(为什么MySQL要选择B+树来存储索引) MySQL的索引选择B+树作为数据结构来进行存储,使用B+树的本质原因在于可以减少IO次数,提高查询的效率,简单来说就是可以保证在树的高度不变的情况下存储更多的数据: IO效率的提高:在MySQL数据库中,…...

云计算day13

一、Git 概述 Git 是一种分布式版本控制系统&#xff0c;用于跟踪和管理代码的变更。它是由 Linus Torvalds 创建的&#xff0c;最初被设计用于 Linux 内核的开发。Git 允许开发 人员跟踪和管理代码的版本&#xff0c;并且可以在不同的开发人员之间进行协作。 Github 用的就…...

2024年孝感中级职称报名开始了吗?

2024年孝感中级职称申报终于开始了&#xff0c;之前参加过水测的小伙伴们&#xff0c;开始准备评审了 2024年孝感本批次申报时间&#xff1a;中级、初级职称网上申报时间:2024年8月1日至8月31日。 注意&#xff1a;个人通过“湖北省职称评审管理信息系统”申报&#xff0c;须先…...

RAG技术之Router

Router有什么用&#xff1f; 在RAG应用中&#xff0c;Router可以帮助我们基于用户的查询意图来决定使用何种数据类型或数据源&#xff0c;比如是否需要进行语义检索、是否需要进行text2sql查询&#xff0c;是否需要用function call来进行API调用。 Router也可以根据用户的查询…...

linux系统通过修改sudo文件使普通用户拥有类似root用户权限

说明&#xff1a;普通用户要想拥有root权限&#xff0c;如果不在sudo文件里配置就算把该用户加到wheel组&#xff08;root用户所在的组&#xff09;也不行。 要想通过在命令前加上sudo使得该用户以root权限执行命令&#xff0c;需要修改/etc/sudoers文件。 &#xff08;如果通…...

基于PyCharm在Windows系统上远程连接Linux服务器中Docker容器进行Python项目开发与部署

文章目录 摘要项目结构项目开发项目上线参考文章 摘要 本文介绍了如何在Windows 10系统上使用PyCharm专业版2024.1&#xff0c;通过Docker容器在阿里云CentOS 7.9服务器上进行Python项目的开发和生产部署。文章详细阐述了项目结构的搭建、PyCharm的使用技巧、以及如何将开发项…...

TypeScript学习篇-类型介绍使用、ts相关面试题

文章目录 基础知识基础类型: number, string, boolean, object, array, undefined, void(代表该函数没有返回值)enum(枚举): 定义一个可枚举的对象typeinterface联合类型: |交叉类型: &any 类型null 和 undefinednullundefined never类型 面试题及实战1. 你觉得使用ts的好处…...

超详细!Jmeter性能测试

前言 性能测试是一个全栈工程师/架构师必会的技能之一&#xff0c;只有学会性能测试&#xff0c;才能根据得到的测试报告进行分析&#xff0c;找到系统性能的瓶颈所在&#xff0c;而这也是优化架构设计中重要的依据。 测试流程&#xff1a; 需求分析→环境搭建→测试计划→脚…...

C语言经典习题24

文件操作习题 一 编程删除从C盘home文件夹下data.txt文本文件中所读取字符串中指定的字符&#xff0c;该指定字符由键盘输入&#xff0c;并将修改后的字符串以追加方式写入到文本文件C:\home\data.txt中。 #include<stdio.h> main() { char s[100],ch; int i;…...

SQL labs-SQL注入(三,sqlmap使用)

本文仅作为学习参考使用&#xff0c;本文作者对任何使用本文进行渗透攻击破坏不负任何责任。 引言&#xff1a; 盲注简述&#xff1a;是在没有回显得情况下采用的注入方式&#xff0c;分为布尔盲注和时间盲注。 布尔盲注&#xff1a;布尔仅有两种形式&#xff0c;ture&#…...

统一认证与单点登录:简明概述与应用

1. 统一认证概述 统一认证是一种身份验证机制&#xff0c;允许用户使用一个账户来访问多个系统和应用程序。它的主要目标是简化用户的登录过程&#xff0c;提高安全性&#xff0c;并减少管理开销。统一认证通过集中管理用户信息&#xff0c;使得用户只需一次认证即可访问不同的…...

MSPM0G3507学习笔记1:开发环境_引脚认识与点灯

今日速通一款Ti的单片机用于电赛&#xff1a;MSPM0G3507 这里默认已经安装好了Keil5_MDK 首先声明一下: 因为是速成&#xff0c;所以需要一定单片机学习基础&#xff0c;然后我写的也不会详细&#xff0c;这个专栏的笔记也就是自己能看懂就行的目标~~~ 文章提供测试代码解…...

使用法国云手机进行面向法国的社媒营销

在当今数字化和全球化的时代&#xff0c;社交媒体已经成为企业营销和拓展市场的重要工具。对于想进入法国市场的企业来说&#xff0c;如何在海外社媒营销中脱颖而出、抓住更多的市场份额&#xff0c;成为了一个关键问题。法国云手机正为企业提供全新的营销工具&#xff0c;助力…...

C++学习笔记——模板

学习视频 文章目录 模板的概念函数模板函数模板语法函数模板注意事项函数模板案例普通函数与函数模板的区别普通函数与函数模板的调用规则模板的局限性 类模板类模板与函数模板区别类模板中成员函数创建时机类模板对象做函数参数类模板与继承类模板成员函数类外实现类模板分文件…...

财务分析,奥威BI行计算助力财务解放报表工作

【财务分析&#xff0c;奥威BI行计算助力财务解放报表工作】 在企业的财务管理体系中&#xff0c;财务报表的编制与分析是至关重要的一环。然而&#xff0c;传统的手工编制报表方式不仅耗时耗力&#xff0c;还难以应对日益复杂多变的财务数据需求。奥威BI&#xff08;Business…...

文件写入、读出-linux

基于linux操作系统&#xff0c;编写存储功能&#xff0c;在网上搜了几个例子&#xff0c;一直报创建错误&#xff0c; fopen(SAVE_PATH_OWN_INF_FILE, "w") fopen(SAVE_PATH_OWN_INF_FILE, "a"), 使用这两个创建均失败&#xff0c;最后发现创建可以用以…...

环境搭建-Windows系统搭建Docker

Windows系统搭建Docker 一、系统虚拟化1.1 启用虚拟化2.2 启用Hyper-v并开启虚拟任务 三、安装WSL3.1 检验安装3.2 安装WSL 四、Docker安装4.1 Docker安装包下载4.2 Docker安装4.3 运行docker Desktop 五、Docker配置5.1 打开Docker配置中心5.2 配置Docker国内镜像 六、使用 一…...

Spark 之 入门讲解详细版(1)

1、简介 1.1 Spark简介 Spark是加州大学伯克利分校AMP实验室&#xff08;Algorithms, Machines, and People Lab&#xff09;开发通用内存并行计算框架。Spark在2013年6月进入Apache成为孵化项目&#xff0c;8个月后成为Apache顶级项目&#xff0c;速度之快足见过人之处&…...

脑机新手指南(八):OpenBCI_GUI:从环境搭建到数据可视化(下)

一、数据处理与分析实战 &#xff08;一&#xff09;实时滤波与参数调整 基础滤波操作 60Hz 工频滤波&#xff1a;勾选界面右侧 “60Hz” 复选框&#xff0c;可有效抑制电网干扰&#xff08;适用于北美地区&#xff0c;欧洲用户可调整为 50Hz&#xff09;。 平滑处理&…...

FastAPI 教程:从入门到实践

FastAPI 是一个现代、快速&#xff08;高性能&#xff09;的 Web 框架&#xff0c;用于构建 API&#xff0c;支持 Python 3.6。它基于标准 Python 类型提示&#xff0c;易于学习且功能强大。以下是一个完整的 FastAPI 入门教程&#xff0c;涵盖从环境搭建到创建并运行一个简单的…...

蓝桥杯 2024 15届国赛 A组 儿童节快乐

P10576 [蓝桥杯 2024 国 A] 儿童节快乐 题目描述 五彩斑斓的气球在蓝天下悠然飘荡&#xff0c;轻快的音乐在耳边持续回荡&#xff0c;小朋友们手牵着手一同畅快欢笑。在这样一片安乐祥和的氛围下&#xff0c;六一来了。 今天是六一儿童节&#xff0c;小蓝老师为了让大家在节…...

在 Nginx Stream 层“改写”MQTT ngx_stream_mqtt_filter_module

1、为什么要修改 CONNECT 报文&#xff1f; 多租户隔离&#xff1a;自动为接入设备追加租户前缀&#xff0c;后端按 ClientID 拆分队列。零代码鉴权&#xff1a;将入站用户名替换为 OAuth Access-Token&#xff0c;后端 Broker 统一校验。灰度发布&#xff1a;根据 IP/地理位写…...

在四层代理中还原真实客户端ngx_stream_realip_module

一、模块原理与价值 PROXY Protocol 回溯 第三方负载均衡&#xff08;如 HAProxy、AWS NLB、阿里 SLB&#xff09;发起上游连接时&#xff0c;将真实客户端 IP/Port 写入 PROXY Protocol v1/v2 头。Stream 层接收到头部后&#xff0c;ngx_stream_realip_module 从中提取原始信息…...

C++ 基础特性深度解析

目录 引言 一、命名空间&#xff08;namespace&#xff09; C 中的命名空间​ 与 C 语言的对比​ 二、缺省参数​ C 中的缺省参数​ 与 C 语言的对比​ 三、引用&#xff08;reference&#xff09;​ C 中的引用​ 与 C 语言的对比​ 四、inline&#xff08;内联函数…...

LeetCode - 199. 二叉树的右视图

题目 199. 二叉树的右视图 - 力扣&#xff08;LeetCode&#xff09; 思路 右视图是指从树的右侧看&#xff0c;对于每一层&#xff0c;只能看到该层最右边的节点。实现思路是&#xff1a; 使用深度优先搜索(DFS)按照"根-右-左"的顺序遍历树记录每个节点的深度对于…...

【从零开始学习JVM | 第四篇】类加载器和双亲委派机制(高频面试题)

前言&#xff1a; 双亲委派机制对于面试这块来说非常重要&#xff0c;在实际开发中也是经常遇见需要打破双亲委派的需求&#xff0c;今天我们一起来探索一下什么是双亲委派机制&#xff0c;在此之前我们先介绍一下类的加载器。 目录 ​编辑 前言&#xff1a; 类加载器 1. …...

WebRTC调研

WebRTC是什么&#xff0c;为什么&#xff0c;如何使用 WebRTC有什么优势 WebRTC Architecture Amazon KVS WebRTC 其它厂商WebRTC 海康门禁WebRTC 海康门禁其他界面整理 威视通WebRTC 局域网 Google浏览器 Microsoft Edge 公网 RTSP RTMP NVR ONVIF SIP SRT WebRTC协…...