C# NPOI操作Excel汇总

news2024/11/24 8:00:33

C#操作Excel有多种方法,如通过数据库的方式来读写Excel的OleDb方式,但是OleDb方式需要安装微软office,还可以通过COM组件方式操作Excel,也需要安装微软Excel。如果不想安装微软办公套餐可以使用ClosedXML、EPPlus、NPOI。本文主要是介绍NPOI的常用使用方法。
Apache POI是Apache软件基金会的开放源码函式库,POI提供API给Java程序对Microsoft Office格式档案读和写的功能。

NuGet安装NPOI

NPO依赖beta版本的SixLabors.Fonts,需要先安装SixLabors.Fonts。
1
然后安装NPOI:
1

主要对象

对象对象说明
HSSFWorkbookexcel文档对象 工作簿 .xls文件
XSSFWorkbookexcel文档对象 工作簿 .xlsx文件
HSSFSheetexcel的sheet 工作表
HSSFRowexcel的行
HSSFName名称
HSSFDateFomat日期格式
HSSFHeadersheet头
HSSFFootersheet尾
HSSFCellStylecell样式
HSSFDateUtil日期
HSSFPrintSetup打印
HSSFErrorConstants错误信息表

HSSF是Horrible SpreadSheet Format的缩写,通过HSSF,你可以使用纯Java代码来读取、写入、修改Microsoft Excel BIFF(Excel 97-2003, xls)文件。HSSF为读取操作提供了两类API:usermodeleventusermodel,即"用户模型"和"用户事件模型"。

读写Excel

using NPOI.SS.UserModel;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WorkbookFactoryDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var stream= File.OpenRead("test.xlsx"))
            {
                IWorkbook workbook = WorkbookFactory.Create(stream);
                //workbook.GetSheetAt(0).CopySheet("Folha1");
                /*for (int i = 0; i < workbook.NumberOfSheets; i++)
                {
                    ISheet sheet = workbook.GetSheetAt(i);
                    Console.WriteLine(sheet.SheetName);
                }*/
                using (FileStream fileWriter = new FileStream("TestOutput.xlsx", FileMode.Create, FileAccess.ReadWrite, FileShare.None))
                {
                    workbook.Write(fileWriter, false);
                }

                Console.ReadLine();
            }
        }
    }
}


遍历Excel所有单元格

using System;
using NPOI.SS.UserModel;

namespace ReadAndPrintData
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;
            using (var workbook = WorkbookFactory.Create("data.xlsx"))
            {
                ISheet sheet = workbook.GetSheetAt(0);
                foreach (IRow row in sheet)
                {
                    for (var i = 0; i < row.LastCellNum; i++)
                    {
                        var cell = row.GetCell(i);
                        if (cell != null)
                        {
                            Console.Write(cell.ToString());
                            Console.Write("\t");
                        }
                    }
                    Console.WriteLine();
                }
            }
            Console.Read();
        }
    }
}

设置文件属性

using NPOI;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System;
using System.IO;

namespace CreateCustomProperties
{
    class Program
    {
        static void Main(string[] args)
        {
            XSSFWorkbook workbook = new XSSFWorkbook();
            ISheet sheet1 = workbook.CreateSheet("Sheet1");

            POIXMLProperties props = workbook.GetProperties();
            props.CoreProperties.Creator = "NPOI 2.5.1";
            props.CoreProperties.Created = DateTime.Now;
            if (!props.CustomProperties.Contains("NPOI Team"))
                props.CustomProperties.AddProperty("NPOI Team", "Hello World!");

            FileStream sw = File.Create("test.xlsx");
            workbook.Write(sw);
            sw.Close();
        }
    }
}

设置单元格值:SetCellValue

using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System.IO;

namespace NPOI.Examples.XSSF.SetCellValuesInXlsx
{
    class Program
    {
        static void Main(string[] args)
        {
            IWorkbook workbook = new XSSFWorkbook();
            ISheet sheet1 = workbook.CreateSheet("Sheet1");
            sheet1.CreateRow(0).CreateCell(0).SetCellValue("This is a Sample");

            int x = 1;

            for (int i = 1; i <= 15; i++)
            {
                IRow row = sheet1.CreateRow(i);
                for (int j = 0; j < 15; j++)
                {
                    row.CreateCell(j).SetCellValue(x++);
                }
            }

            FileStream sw = File.Create("test.xlsx");
            workbook.Write(sw);
            sw.Close();
        }
    }
}

填充日期

using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;

using (IWorkbook workbook = new XSSFWorkbook())
{
    ISheet sheet = workbook.CreateSheet("Sheet1");
    //increase the width of Column A
    sheet.SetColumnWidth(0, 5000);
    //create the format instance
    IDataFormat format = workbook.CreateDataFormat();

    
    //Chinese date string
    ICell cell7 = sheet.CreateRow(6).CreateCell(0);
    SetValueAndFormat(workbook, cell7, new DateOnly(2004, 5, 6), format.GetFormat("yyyy年m月d日"));

    using (FileStream sw = File.Create("test.xlsx"))
    {
        workbook.Write(sw, false);
    }
}

static void SetValueAndFormat(IWorkbook workbook, ICell cell, DateOnly value, short formatId)
{
    //set value for the cell
    cell.SetCellValue(value);

    ICellStyle cellStyle = workbook.CreateCellStyle();
    cellStyle.DataFormat = formatId;
    cell.CellStyle = cellStyle;
}

设置背景色

using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System.IO;

namespace NPOI.Examples.XSSF.FillBackgroundInXlsx
{
    class Program
    {
        static void Main(string[] args)
        {
            using (IWorkbook workbook = new XSSFWorkbook())
            {
                ISheet sheet1 = workbook.CreateSheet("Sheet1");

                //fill background
                ICellStyle style1 = workbook.CreateCellStyle();
                style1.FillForegroundColor = IndexedColors.Blue.Index;
                style1.FillPattern = FillPattern.BigSpots;
                style1.FillBackgroundColor = IndexedColors.Pink.Index;
                sheet1.CreateRow(0).CreateCell(0).CellStyle = style1;

                //fill background
                ICellStyle style2 = workbook.CreateCellStyle();
                style2.FillForegroundColor = IndexedColors.Yellow.Index;
                style2.FillPattern = FillPattern.AltBars;
                style2.FillBackgroundColor = IndexedColors.Rose.Index;
                sheet1.CreateRow(1).CreateCell(0).CellStyle = style2;

                //fill background
                ICellStyle style3 = workbook.CreateCellStyle();
                style3.FillForegroundColor = IndexedColors.Lime.Index;
                style3.FillPattern = FillPattern.LessDots;
                style3.FillBackgroundColor = IndexedColors.LightGreen.Index;
                sheet1.CreateRow(2).CreateCell(0).CellStyle = style3;

                //fill background
                ICellStyle style4 = workbook.CreateCellStyle();
                style4.FillForegroundColor = IndexedColors.Yellow.Index;
                style4.FillPattern = FillPattern.LeastDots;
                style4.FillBackgroundColor = IndexedColors.Rose.Index;
                sheet1.CreateRow(3).CreateCell(0).CellStyle = style4;

                //fill background
                ICellStyle style5 = workbook.CreateCellStyle();
                style5.FillForegroundColor = IndexedColors.LightBlue.Index;
                style5.FillPattern = FillPattern.Bricks;
                style5.FillBackgroundColor = IndexedColors.Plum.Index;
                sheet1.CreateRow(4).CreateCell(0).CellStyle = style5;

                //fill background
                ICellStyle style6 = workbook.CreateCellStyle();
                style6.FillForegroundColor = IndexedColors.SeaGreen.Index;
                style6.FillPattern = FillPattern.FineDots;
                style6.FillBackgroundColor = IndexedColors.White.Index;
                sheet1.CreateRow(5).CreateCell(0).CellStyle = style6;

                //fill background
                ICellStyle style7 = workbook.CreateCellStyle();
                style7.FillForegroundColor = IndexedColors.Orange.Index;
                style7.FillPattern = FillPattern.Diamonds;
                style7.FillBackgroundColor = IndexedColors.Orchid.Index;
                sheet1.CreateRow(6).CreateCell(0).CellStyle = style7;

                //fill background
                ICellStyle style8 = workbook.CreateCellStyle();
                style8.FillForegroundColor = IndexedColors.White.Index;
                style8.FillPattern = FillPattern.Squares;
                style8.FillBackgroundColor = IndexedColors.Red.Index;
                sheet1.CreateRow(7).CreateCell(0).CellStyle = style8;

                //fill background
                ICellStyle style9 = workbook.CreateCellStyle();
                style9.FillForegroundColor = IndexedColors.RoyalBlue.Index;
                style9.FillPattern = FillPattern.SparseDots;
                style9.FillBackgroundColor = IndexedColors.Yellow.Index;
                sheet1.CreateRow(8).CreateCell(0).CellStyle = style9;

                //fill background
                ICellStyle style10 = workbook.CreateCellStyle();
                style10.FillForegroundColor = IndexedColors.RoyalBlue.Index;
                style10.FillPattern = FillPattern.ThinBackwardDiagonals;
                style10.FillBackgroundColor = IndexedColors.Yellow.Index;
                sheet1.CreateRow(9).CreateCell(0).CellStyle = style10;

                //fill background
                ICellStyle style11 = workbook.CreateCellStyle();
                style11.FillForegroundColor = IndexedColors.RoyalBlue.Index;
                style11.FillPattern = FillPattern.ThickForwardDiagonals;
                style11.FillBackgroundColor = IndexedColors.Yellow.Index;
                sheet1.CreateRow(10).CreateCell(0).CellStyle = style11;

                //fill background
                ICellStyle style12 = workbook.CreateCellStyle();
                style12.FillForegroundColor = IndexedColors.RoyalBlue.Index;
                style12.FillPattern = FillPattern.ThickHorizontalBands;
                style12.FillBackgroundColor = IndexedColors.Yellow.Index;
                sheet1.CreateRow(11).CreateCell(0).CellStyle = style12;


                //fill background
                ICellStyle style13 = workbook.CreateCellStyle();
                style13.FillForegroundColor = IndexedColors.RoyalBlue.Index;
                style13.FillPattern = FillPattern.ThickVerticalBands;
                style13.FillBackgroundColor = IndexedColors.Yellow.Index;
                sheet1.CreateRow(12).CreateCell(0).CellStyle = style13;

                //fill background
                ICellStyle style14 = workbook.CreateCellStyle();
                style14.FillForegroundColor = IndexedColors.RoyalBlue.Index;
                style14.FillPattern = FillPattern.ThickBackwardDiagonals;
                style14.FillBackgroundColor = IndexedColors.Yellow.Index;
                sheet1.CreateRow(13).CreateCell(0).CellStyle = style14;

                //fill background
                ICellStyle style15 = workbook.CreateCellStyle();
                style15.FillForegroundColor = IndexedColors.RoyalBlue.Index;
                style15.FillPattern = FillPattern.ThinForwardDiagonals;
                style15.FillBackgroundColor = IndexedColors.Yellow.Index;
                sheet1.CreateRow(14).CreateCell(0).CellStyle = style15;

                //fill background
                ICellStyle style16 = workbook.CreateCellStyle();
                style16.FillForegroundColor = IndexedColors.RoyalBlue.Index;
                style16.FillPattern = FillPattern.ThinHorizontalBands;
                style16.FillBackgroundColor = IndexedColors.Yellow.Index;
                sheet1.CreateRow(15).CreateCell(0).CellStyle = style16;

                //fill background
                ICellStyle style17 = workbook.CreateCellStyle();
                style17.FillForegroundColor = IndexedColors.RoyalBlue.Index;
                style17.FillPattern = FillPattern.ThinVerticalBands;
                style17.FillBackgroundColor = IndexedColors.Yellow.Index;
                sheet1.CreateRow(16).CreateCell(0).CellStyle = style17;

                //fill background with gradient color, this only works with NPOI 2.6.0
                XSSFCellStyle style18 = (XSSFCellStyle)workbook.CreateCellStyle();
                style18.FillPattern = FillPattern.SolidForeground;
                var fillidx = (int)style18.GetCoreXf().fillId;
                var ctfill = ((XSSFWorkbook)workbook).GetStylesSource().GetFillAt(fillidx).GetCTFill();
                ctfill.UnsetPatternFill();
                byte[] rgb1 = new byte[3];
                rgb1[0] = (byte)0; // red
                rgb1[1] = (byte)0; // green
                rgb1[2] = (byte)255; // blue

                byte[] rgb2 = new byte[3];
                rgb2[0] = (byte)255; // red
                rgb2[1] = (byte)255; // green
                rgb2[2] = (byte)255; // blue

                ctfill.gradientFill = new OpenXmlFormats.Spreadsheet.CT_GradientFill();
                var ctgradientfill = ctfill.gradientFill;
                ctgradientfill.degree = 90;
                ctgradientfill.AddNewStop().position = 0;
                ctgradientfill.GetStopArray(0).AddNewColor().SetRgb(rgb1);
                ctgradientfill.AddNewStop().position = 0.5;
                ctgradientfill.GetStopArray(1).AddNewColor().SetRgb(rgb2);
                ctgradientfill.AddNewStop().position = 1.0;
                ctgradientfill.GetStopArray(2).AddNewColor().SetRgb(rgb1);

                sheet1.CreateRow(16).CreateCell(0).CellStyle = style18;

                using (FileStream sw = File.Create("test.xlsx"))
                {
                    workbook.Write(sw, false);
                }
            }
        }
    }
}

设置宽高

using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System.IO;

namespace NPOI.Examples.XSSF.SetWidthAndHeightInXlsx
{
    class Program
    {
        static void Main(string[] args)
        {
            using (IWorkbook workbook = new XSSFWorkbook())
            {
                ISheet sheet1 = workbook.CreateSheet("Sheet1");

                //set the width of columns
                sheet1.SetColumnWidth(0, 50 * 256);
                sheet1.SetColumnWidth(1, 100 * 256);
                sheet1.SetColumnWidth(2, 150 * 256);

                //set the width of height
                sheet1.CreateRow(0).Height = 100 * 20;
                sheet1.CreateRow(1).Height = 200 * 20;
                sheet1.CreateRow(2).Height = 300 * 20;

                using (FileStream sw = File.Create("test.xlsx"))
                {
                    workbook.Write(sw, false);
                }
            }
        }
    }
}

折线图

using NPOI.SS.UserModel;
using NPOI.SS.UserModel.Charts;
using NPOI.SS.Util;
using NPOI.XSSF.UserModel;
using System.IO;

namespace LineChart
{
    class Program
    {
        const int NUM_OF_ROWS = 3;
        const int NUM_OF_COLUMNS = 10;

        static void CreateChart(IDrawing drawing, ISheet sheet, IClientAnchor anchor, string serie1, string serie2, bool enableMajorGridline=false)
        {
            XSSFChart chart = (XSSFChart)drawing.CreateChart(anchor);
            chart.SetTitle("Test 1");
            IChartLegend legend = chart.GetOrCreateLegend();
            legend.Position = LegendPosition.TopRight;

            ILineChartData<double, double> data = chart.ChartDataFactory.CreateLineChartData<double, double>();

            // Use a category axis for the bottom axis.
            IChartAxis bottomAxis = chart.ChartAxisFactory.CreateCategoryAxis(AxisPosition.Bottom);
            IValueAxis leftAxis = chart.ChartAxisFactory.CreateValueAxis(AxisPosition.Left);
            leftAxis.Crosses = AxisCrosses.AutoZero;

            IChartDataSource<double> xs = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1));
            IChartDataSource<double> ys1 = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(1, 1, 0, NUM_OF_COLUMNS - 1));
            IChartDataSource<double> ys2 = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1));

            var s1 = data.AddSeries(xs, ys1);
            s1.SetTitle(serie1);
            var s2 = data.AddSeries(xs, ys2);
            s2.SetTitle(serie2);

            chart.Plot(data, bottomAxis, leftAxis);
            //add major gridline, available since NPOI 2.5.5
            var plotArea = chart.GetCTChart().plotArea;
            plotArea.catAx[0].AddNewMajorGridlines();
            plotArea.valAx[0].AddNewMajorGridlines();
            
        }

        static void Main(string[] args)
        {
            using (IWorkbook wb = new XSSFWorkbook())
            {
                ISheet sheet = wb.CreateSheet("linechart");


                // Create a row and put some cells in it. Rows are 0 based.
                IRow row;
                ICell cell;
                for (int rowIndex = 0; rowIndex < NUM_OF_ROWS; rowIndex++)
                {
                    row = sheet.CreateRow((short)rowIndex);
                    for (int colIndex = 0; colIndex < NUM_OF_COLUMNS; colIndex++)
                    {
                        cell = row.CreateCell((short)colIndex);
                        cell.SetCellValue(colIndex * (rowIndex + 1));
                    }
                }

                IDrawing drawing = sheet.CreateDrawingPatriarch();
                IClientAnchor anchor1 = drawing.CreateAnchor(0, 0, 0, 0, 0, 5, 10, 15);
                CreateChart(drawing, sheet, anchor1, "title1", "title2");
                IClientAnchor anchor2 = drawing.CreateAnchor(0, 0, 0, 0, 0, 20, 10, 35);
                CreateChart(drawing, sheet, anchor2, "s1", "s2", true);
                using (FileStream fs = File.Create("test.xlsx"))
                {
                    wb.Write(fs, false);
                }
            }
        }
    }
}

条形图

using NPOI.SS.UserModel;
using NPOI.SS.UserModel.Charts;
using NPOI.SS.Util;
using NPOI.XSSF.UserModel;
using System;
using System.IO;

namespace BarChart
{
    class Program
    {
        const int NUM_OF_ROWS = 10;
        const int NUM_OF_COLUMNS = 2;
        private static void CreateChart(ISheet sheet, IDrawing drawing, IClientAnchor anchor,  string serieTitle, int startDataRow, int endDataRow, int columnIndex)
        {
            XSSFChart chart = (XSSFChart)drawing.CreateChart(anchor);

            IBarChartData<string, double> barChartData = chart.ChartDataFactory.CreateBarChartData<string, double>();
            IChartLegend legend = chart.GetOrCreateLegend();
            legend.Position = LegendPosition.Bottom;

            IChartAxis bottomAxis = chart.ChartAxisFactory.CreateCategoryAxis(AxisPosition.Bottom);
            bottomAxis.MajorTickMark = AxisTickMark.None;
            IValueAxis leftAxis = chart.ChartAxisFactory.CreateValueAxis(AxisPosition.Left);
            leftAxis.Crosses = AxisCrosses.AutoZero;
            leftAxis.SetCrossBetween(AxisCrossBetween.Between);


            IChartDataSource<string> categoryAxis = DataSources.FromStringCellRange(sheet, new CellRangeAddress(startDataRow, endDataRow, 0, 0));
            IChartDataSource<double> valueAxis = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(startDataRow, endDataRow, columnIndex, columnIndex));
            var serie = barChartData.AddSeries(categoryAxis, valueAxis);
            serie.SetTitle(serieTitle);

            chart.Plot(barChartData, bottomAxis, leftAxis);
        }
        static void Main(string[] args)
        {
            using (IWorkbook wb = new XSSFWorkbook())
            {
                ISheet sheet = wb.CreateSheet();


                // Create a row and put some cells in it. Rows are 0 based.
                IRow row;
                ICell cell;
                for (int rowIndex = 0; rowIndex < NUM_OF_ROWS; rowIndex++)
                {
                    row = sheet.CreateRow((short)rowIndex);
                    for (int colIndex = 0; colIndex < NUM_OF_COLUMNS; colIndex++)
                    {
                        cell = row.CreateCell((short)colIndex);
                        if (colIndex == 0)
                            cell.SetCellValue("X" + rowIndex);
                        else
                        {
                            var x = colIndex * (rowIndex + 1);
                            cell.SetCellValue(x * x + 2 * x + 1);
                        }
                    }
                }
                XSSFDrawing drawing = (XSSFDrawing)sheet.CreateDrawingPatriarch();
                XSSFClientAnchor anchor = (XSSFClientAnchor)drawing.CreateAnchor(0, 0, 0, 0, 3, 3, 10, 12);

                CreateChart(sheet, drawing, anchor, "s1", 0, 9, 1);
                using (FileStream fs = File.Create("test.xlsx"))
                {
                    wb.Write(fs, false);
                }
            }
        }
    }
}

设置打印范围

using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System;
using System.IO;

namespace SetPrintArea
{
    class Program
    {
        static IWorkbook workbook;
        static void Main(string[] args)
        {
            InitializeWorkbook(args);
            ISheet sheet = workbook.CreateSheet("Timesheet");
            sheet.CreateRow(0).CreateCell(0).SetCellValue("Test");
            workbook.SetPrintArea(0, "$A$1:$C$5");

            //workbook.SetPrintArea(0, "$A$1:$C$5,$E$9:$I$16");  not working in xls
            WriteToFile();
        }
        static void WriteToFile()
        {
            string filename = "timesheet.xls";
            if (workbook is XSSFWorkbook) filename += "x";
            //Write the stream data of workbook to the root directory
            using (FileStream file = new FileStream(filename, FileMode.Create))
            {
                workbook.Write(file);
            }
        }

        static void InitializeWorkbook(string[] args)
        {
            if (args.Length > 0 && args[0].Equals("-xls"))
                workbook = new HSSFWorkbook();
            else
                workbook = new XSSFWorkbook();
        }

    }
}

参考

https://github.com/nissl-lab/npoi
https://github.com/nissl-lab/npoi-examples
https://blog.csdn.net/weixin_44899642/article/details/124687499

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/725396.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【网络系统集成】VLAN实验

1.实验名称:VLAN实验 2.实验目的 在PacketTracer中进行模拟VLAN实验,完成“不同交换机相同VLAN间通讯”实验、“单臂路由”实验与“三层交换实现VLAN间通讯”实验,加深对VLAN间通讯相关知识的理解与掌握。 3.实验内容 3.1不同交换机相同VLAN间通讯 (1)拓扑结构图

STM32——关于时钟源的实际使用及解释

1、STM32内部有5个时钟源&#xff0c;分别为HSI、HSE、LSE、LSI、PLL。 HSE&#xff1a;高速外部时钟&#xff0c;可接石英谐振器、陶瓷谐振器&#xff0c;或者接外部时钟源&#xff0c;其频率范围为4MHZ~16MHZ。 LSE&#xff1a; 低速外部时钟&#xff0c;接频率为32.768KHZ…

ATFX国际:小非农ADP数据来袭,加息预期或再度升温

ATFX国际&#xff1a;每月发布一次的ADP数据是国际金融市场的大事件&#xff0c;它能够对周五发布的非农就业报告起到相对准确的前瞻作用。今日晚间20:15&#xff0c;美国6月ADP就业人数将发布&#xff0c;前值为增加27.8万人&#xff0c;预期值增加22.8万人&#xff0c;市场预…

【Quartus FPGA】EMIF DDR3 IP 仿真记录

EMIF (External Memory Interface) 是 Quartus 平台提供的 IP&#xff0c;用于实现高速存储器件接口与控制器。通过 Intel Quartus Prime 软件&#xff0c;可以很方便地实现 EMIF IP 电路。本文记录了使用 EMIF 实现 DDR3 控制器的仿真过程&#xff0c;软件平台为 Quartus Prim…

软件测试体系方案

目录 前言&#xff1a; 1. 引言 1.1 目标 1.2 背景 1.3 术语和定义 2. 测试体系完善 2.1 项目启动 2.2 测试计划 2.3 需求分析 2.4 测试设计 2.5 测试执行 2.6 测试记录 2.7 缺陷跟踪 2.8 测试结束 2.9 测试总结 3. 测试管理规划 3.1 测试人员 3.2 测试环境 …

骑行,怎么样高效而省力的摇车?

大家好&#xff0c;今天我们来聊一聊自行车运动中的摇车技巧。我们知道&#xff0c;摇车是自行车运动中一种非常高效的发力方式&#xff0c;那么如何做到高效而省力的摇车呢&#xff1f; 首先&#xff0c;我们要了解摇车的原理。摇车&#xff0c;其实就是通过腿部蹬踏的方式&am…

(02)Cartographer源码无死角解析-(78) ROS数据发布→2D点云数据、tf、机器人tracking frame轨迹发布

讲解关于slam一系列文章汇总链接:史上最全slam从零开始&#xff0c;针对于本栏目讲解(02)Cartographer源码无死角解析-链接如下: (02)Cartographer源码无死角解析- (00)目录_最新无死角讲解&#xff1a;https://blog.csdn.net/weixin_43013761/article/details/127350885 文…

【MTK】ES7210、ES7243E Driver调试

文章目录 1.概要2.整体架构流程3. ES7210、ES7243E Driver4. 调试过程中的问题点小结1.概要 由于项目需要实现 4 路MIC 以及 2 路Speaker回采输入android系统,硬件是一个ES7210用来采集4路MIC,一个ES7243E用来采集2路Speaker回采,组成类似6路麦克风输入系统。系统SoC无法支持…

“前端刘德华”Pink老师送签名图书啦

就算成功的概率为1%又如何呢&#xff0c;如太阳系般波澜壮阔&#xff0c;也只有0.14%产生了生命&#xff0c;平凡的我们绝大多数也终将如整个太阳系的99.86%一般化作死寂。 但这不重要朋友&#xff0c;今天是黑马疯狂星期四&#xff0c;Pink老师开讲了&#xff01;&#xff01…

跑马灯实验(stm32)

目录 LED的功能代码led.cled.h硬件相关说明 main.c代码的一些介绍BSRR和BRR 实验结果 说明&#xff1a;以下内容参考正点原子的相关资料 LED的功能代码 led.c void LED_Init(void) {GPIO_InitTypeDef GPIO_InitStructure;RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_A…

单月涨粉30w,小红书涨粉秘诀是什么?

6月&#xff0c;小红书平台又涌现出哪些优质博主&#xff1f;品牌在投放种草方面有何亮眼表现&#xff1f; 为洞察小红书平台的内容创作趋势及品牌营销策略&#xff0c;新红推出6月月度榜单&#xff0c;从创作者、品牌、品类多方面入手&#xff0c;解析月榜数据&#xff0c;为从…

耗时半月,终于把牛客网上的软件测试面试八股文整理成PDF合集!

大家好&#xff0c;最近收到不少小伙伴的留言&#xff0c;反映现在的面试难度越来越高&#xff0c;要背的八股文越来越多了&#xff0c;考察的知识点也越来越细致&#xff0c;明摆着就是想让我们“徒手造航母”嘛&#xff01;对程序员们来说确实是一大挑战。 因此&#xff0c;…

Win10快捷方式添加到开始菜单或磁贴

打开Windows文件夹&#xff0c;进入该目录(用户名替换为当前用户)&#xff1a;C:\Users\[你的用户名]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs 将应用的快捷方式复制到此目录下&#xff0c;即可展示在开始菜单中可以右键在将快捷方式固定到磁贴

【UnityDOTS 小知识】在DOTS中实例化Prefab的方法

在DOTS中实例化Prefab的方法 前言 实例化Prefab的方法常规方法&#xff1a; 1.利用Baker的方式&#xff0c;以及getEntity方法&#xff0c;将prefab转化为一个对应的Entity原型&#xff0c;再利用EntityManager或ECB的Instantiate方法实例化这个Entity原型得到对应Prefab的实…

LSTD: A Low-Shot Transfer Detector for Object Detection论文阅读笔记

LSTD: A Low-Shot Transfer Detector for Object Detection论文阅读笔记 提出low-shot Transfer detector&#xff0c;来解决标注样本数据不足的情况。利用source domain知识&#xff0c;来构建高效的target-domain检测器&#xff0c;仅需要很少的训练样本。 提出了一个高效的…

第一课:Figma 软件安装与汉化

Figma软件基本介绍 Figma 是一款可在线协作的UI设计软件&#xff0c;最大的亮点在于它基于 WEB 平台研发&#xff0c;能支撑全平台操作系统的运行&#xff0c;适合各种场景下的使用。Figma软件特色功能&#xff1a; 在线编辑&#xff0c;适配全平台&#xff1a;使用软件 Figma…

Python 利用opencv实现识别最大面积验证码

此篇文章解决的是某象的最大验证码,这个最大面积验证码,就是识别图中划线区域中最大面积的验证码,我一开始打算用深度学习去做,但是结合了网上的资料以及自己的想法来看,还是用opencv处理又快又较为准确,而且还不用准备深度学习的一些环境 我准备了大概几十张验证码,经过…

Linux运维-修改密码报错提示:authentication token manipulation error

背景 今天在Linux Centos7环境的使用中,突然遇到了这个问题,为了以后再次遇到后可以快速的解决问题&#xff0c;特此记录。 首先是无法进入系统,然后通过单用户进入系统后修改密码,然后遇到该问题。 单用户进入系统 在如下位置添加init/bin/bash 后按Ctrl X 重启系统 进入b…

联想凌拓数据管理平台—— MagnaScale 分布式存储软件

MagnaScale 分布式存储软件 MagnaScale 数据管理平台是联想凌拓自研 ThinkSystem DXN 非结构化存储的核心软件&#xff0c;具有高性能、高可用性、横向扩展的特点。 MagnaScale 解决方案 是 DXN 非结构化存储的核心软件&#xff0c;能够真正实现软硬件解耦&#xff0c;为客户提…

在 VS Code 的 User Snippets 中使用美元符号 $ 失败的问题

在 VS Code 的 User Snippets 中使用美元符号 $ 失败的问题 在日常工作里经常会用到一些常用的代码片段, 比如创建一个 .vue 文件的初始结构, 所以我会选择在 VS Code 的 User Snippet 中创建一个代码片段, 如下 {"Print to console": {"scope": "v…