mirror of
https://gitee.com/dotnetchina/MiniExcel.git
synced 2024-12-02 03:47:41 +08:00
39 lines
1.4 KiB
C#
39 lines
1.4 KiB
C#
<Query Kind="Program">
|
|
<NuGetReference>Dapper</NuGetReference>
|
|
<NuGetReference>MiniExcel</NuGetReference>
|
|
<NuGetReference>Newtonsoft.Json</NuGetReference>
|
|
<NuGetReference>System.Data.SqlClient</NuGetReference>
|
|
<Namespace>Dapper</Namespace>
|
|
<Namespace>MiniExcelLibs</Namespace>
|
|
<Namespace>Newtonsoft.Json</Namespace>
|
|
<RemoveNamespace>System.Data</RemoveNamespace>
|
|
<RemoveNamespace>System.Diagnostics</RemoveNamespace>
|
|
<RemoveNamespace>System.Linq.Expressions</RemoveNamespace>
|
|
<RemoveNamespace>System.Text</RemoveNamespace>
|
|
<RemoveNamespace>System.Text.RegularExpressions</RemoveNamespace>
|
|
<RemoveNamespace>System.Threading</RemoveNamespace>
|
|
<RemoveNamespace>System.Transactions</RemoveNamespace>
|
|
<RemoveNamespace>System.Xml</RemoveNamespace>
|
|
<RemoveNamespace>System.Xml.Linq</RemoveNamespace>
|
|
<RemoveNamespace>System.Xml.XPath</RemoveNamespace>
|
|
</Query>
|
|
|
|
void Main()
|
|
{
|
|
var path = @"D:\git\MiniExcel\samples\xlsx\Test1,000,000x10\Test1,000,000x10.xlsx";
|
|
|
|
var rows = MiniExcel.Query(path);
|
|
|
|
Console.WriteLine("==== No.1 Page ====");
|
|
Console.WriteLine(Page(rows,pageSize:3,page:1));
|
|
Console.WriteLine("==== No.50 Page ====");
|
|
Console.WriteLine(Page(rows,pageSize:3,page:50));
|
|
Console.WriteLine("==== No.5000 Page ====");
|
|
Console.WriteLine(Page(rows,pageSize:3,page:5000));
|
|
}
|
|
|
|
public static IEnumerable<T> Page<T>(IEnumerable<T> en, int pageSize, int page)
|
|
{
|
|
return en.Skip(page * pageSize).Take(pageSize);
|
|
}
|