Comment lire des données depuis Excel en C#
- Lire des données ou Excel Tutoriel
- Lecteur Excel C# pour les développeurs C#
- Bibliothèque Excel fiable en C#
Ou téléchargez directement la DLL ici
Lire les fichiers Excel sans Interop
Voir tous les exemples de code %susing 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);
Imports IronXL
Imports System
Imports System.Linq
' Supported for XLSX, XLS, XLSM, XLTX, CSV and TSV
Dim workBook As WorkBook = WorkBook.Load("sample.xlsx")
' Select worksheet at index 0
Dim workSheet As WorkSheet = workBook.WorkSheets(0)
' Get any existing worksheet
Dim firstSheet As WorkSheet = workBook.DefaultWorkSheet
' Select a cell and return the converted value
Dim cellValue As Integer = workSheet("A2").IntValue
' Read from ranges of cells elegantly.
For Each cell In workSheet("A2:A10")
Console.WriteLine("Cell {0} has value '{1}'", cell.AddressString, cell.Text)
Next
' Calculate aggregate values such as Min, Max and Sum
Dim sum As Decimal = workSheet("A2:A10").Sum()
' Linq compatible
Dim max As Decimal = workSheet("A2:A10").Max(Function(c) c.DecimalValue)Explorez le code et exécutez-le pour voir les exemples de PDF
Lecture et écriture des fichiers Excel en C#...

Support humain
Parlez directement avec notre équipe de développement
Poser une question
Documentation
Manuels en ligne clairs en anglais simple.
Voir la documentation
Licences simples
Licence de développement gratuite. Commercial à partir de 749 $.
Parcourir les options
Commencez maintenant
Commencez en quelques minutes avec NuGet ou DLL.
Installer & essayer maintenant