跳過到頁腳內容
IronXL 標誌 .NET使用

立刻開始您的IronXL
免費試用

  • 建立和編輯 Excel 文件公式、圖表和圖片
  • 設置儲存格、邊框、字體樣式,及新增超連結
  • 相容於 XLSX、XLS、CSV、TSV、XML 和 DataTables
  • 免費30天試用,完整功能,無需信用卡
Trial key

立即獲取您的免費 30天試用密鑰

試用授權將寄送到此地址

Check icon 無需信用卡或建立帳號

Test Icon

在實際環境中測試

在生產環境中測試而不帶水印。
適用於您所需的任何地方。

Functional Icon

功能完善的產品

獲得 30 天完整功能產品。
幾分鐘內即可運行。

Support Icon

24/5 技術支持

在您的產品試用期間全面訪問我們的支持技術團隊

讀取 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);
Imports IronXL
Imports System
Imports System.Linq

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

' Select worksheet at index 0
Private workSheet As WorkSheet = workBook.WorkSheets(0)

' Get any existing worksheet
Private firstSheet As WorkSheet = workBook.DefaultWorkSheet

' Select a cell and return the converted value
Private 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 cell

' 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)
Install-Package IronXL.Excel

探索程式碼並運行它以查看範例。

世界級工程,
24小時支援
  • Support Team Member 2 related to 立刻開始您的IronXL
免費試用
  • Support Team Member 4 related to 立刻開始您的IronXL
免費試用
  • Support Team Member 6 related to 立刻開始您的IronXL
免費試用
  • Support Team Member 7 related to 立刻開始您的IronXL
免費試用
  • Support Team Member Iron related to 立刻開始您的IronXL
免費試用
與專家交談

鋼鐵支援團隊

我們每週 5 天,每天 24 小時在線上。
聊天
電子郵件
打電話給我