IronXL은 C# .NET용 Excel 스프레드시트 라이브러리입니다.

C#에서 Excel 파일의 데이터를 읽는 방법

  1. 데이터 또는 엑셀 파일을 읽습니다. 지도 시간
  2. C# Excel 읽기 도구 C# 개발자를 위한
  3. 신뢰할 수 있는 C# Excel 라이브러리

또는 여기에서 DLL 파일을 직접 다운로드하세요.

Interop 없이 Excel 파일 읽기
코드 예제 모두 보기
using IronXL;
using System;
using System.Linq;

// Supported for XLSX, XLS, XLSM, XLTX, CSV and TSV
WorkBook workBook = WorkBook.Load("sample.xlsx");

// Select worksheet at index 0
WorkSheet workSheet = workBook.WorkSheets[0];

// Get any existing worksheet
WorkSheet firstSheet = workBook.DefaultWorkSheet;

// Select a cell and return the converted value
int cellValue = workSheet["A2"].IntValue;

// Read from ranges of cells elegantly.
foreach (var cell in workSheet["A2:A10"])
{
    Console.WriteLine("Cell {0} has value '{1}'", cell.AddressString, cell.Text);
}

// Calculate aggregate values such as Min, Max and Sum
decimal sum = workSheet["A2:A10"].Sum();

// Linq compatible
decimal max = workSheet["A2:A10"].Max(c => c.DecimalValue);
NuGet Downloads Badge
PM >Install-Package IronXL.Excel
코드를 살펴보고 실행하여 샘플 PDF를 확인하세요.