91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 8.40MB
    文件類型: .rar
    金幣: 2
    下載: 1 次
    發布日期: 2021-04-04
  • 語言: C#
  • 標簽: C#??NPOI??Winform??

資源簡介

C# .NET NPOI導入EXcel Winform

資源截圖

代碼片段和文件信息

using?NPOIExcel.App_Data;
using?NPOIExcel.Model;
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.IO;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;

namespace?NPOIExcel
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}

????????private?void?btnImport_Click(object?sender?EventArgs?e)
????????{
??????????
????????????OpenFileDialog?sflg?=?new?OpenFileDialog();
????????????//?sflg.Filter?=?“Excel(*.xls)|*.xls|Excel(*.xlsx)|*.xlsx“;
????????????sflg.Filter?=?“Excel(*.xlsx)|*.xlsx|Excel(*.xls)|*.xls“;
????????????if?(sflg.ShowDialog()?==?System.Windows.Forms.DialogResult.Cancel)
????????????{
????????????????return;
????????????}
????????????this.txtPath.Text?=?sflg.FileName;

????????}
????????///?
????????///?Excel數據讀取2007版本之后包括2007
????????///?

????????///?
????????///?
????????public?DataSet?XSSBackDateTable(FileStream?fs)
????????{
????????????
????????????????DataSet?ds?=?new?DataSet();
????????????????DataTable?dt?=?null;
????????????try
????????????{
????????????????NPOI.XSSF.UserModel.XSSFWorkbook?book?=?new?NPOI.XSSF.UserModel.XSSFWorkbook(fs);
????????????????int?sheetCount?=?book.NumberOfSheets;
????????????????//循環表格sheet表
????????????????for?(int?sheetIndex?=?0;?sheetIndex?????????????????{
????????????????????NPOI.SS.UserModel.ISheet?sheet?=?book.GetSheetAt(sheetIndex);
????????????????????if?(sheet?==?null)?continue;

????????????????????NPOI.SS.UserModel.IRow?row?=?sheet.GetRow(0);
????????????????????if?(row?==?null)?continue;

????????????????????int?firstCellNum?=?row.FirstCellNum;
????????????????????int?lastCellNum?=?row.LastCellNum;
????????????????????if?(firstCellNum?==?lastCellNum)?continue;

????????????????????dt?=?new?DataTable(sheet.SheetName);
????????????????????//循環列
????????????????????for?(int?i?=?firstCellNum;?i?????????????????????{
????????????????????????dt.Columns.Add(row.GetCell(i).StringCellValue?typeof(string));
????????????????????}
????????????????????//循環行
????????????????????for?(int?i?=?1;?i?<=?sheet.LastRowNum;?i++)
????????????????????{
????????????????????????DataRow?newRow?=?dt.Rows.Add();
????????????????????????//循環該行的每一列
????????????????????????for?(int?j?=?firstCellNum;?j?????????????????????????{
????????????????????????????if?(sheet.GetRow(i).GetCell(j)?!=?null)
????????????????????????????{
????????????????????????????????newRow[j]?=?sheet.GetRow(i).GetCell(j).StringCellValue;
????????????????????????????}
????????????????????????????else
????????????????????????????{
????????????????????????????????continue;
????????????????????????????}
????????????????????????}
??????????????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

????..A..H.?????82432??2018-11-21?09:01??NPOIOffice\.vs\NPOIOffice\v15\.suo

?????文件??????????0??2018-11-19?17:16??NPOIOffice\.vs\NPOIOffice\v15\Server\sqlite3\db.lock

?????文件?????925696??2018-11-20?13:08??NPOIOffice\.vs\NPOIOffice\v15\Server\sqlite3\storage.ide

?????文件??????32768??2018-11-20?17:21??NPOIOffice\.vs\NPOIOffice\v15\Server\sqlite3\storage.ide-shm

?????文件????4148872??2018-11-21?09:01??NPOIOffice\.vs\NPOIOffice\v15\Server\sqlite3\storage.ide-wal

?????文件????????320??2018-11-20?11:30??NPOIOffice\NPOIExcel\App.config

?????文件???????2104??2018-11-20?14:03??NPOIOffice\NPOIExcel\App_Data\AliIotDeviceInfiDB.cs

?????文件????????213??2018-11-20?10:54??NPOIOffice\NPOIExcel\App_Data\GetConfigMsg.cs

?????文件?????144896??2016-07-01?18:38??NPOIOffice\NPOIExcel\bin\Debug\Dapper.dll

?????文件?????103641??2016-07-01?18:38??NPOIOffice\NPOIExcel\bin\Debug\Dapper.xml

?????文件?????200704??2011-01-03?14:16??NPOIOffice\NPOIExcel\bin\Debug\ICSharpCode.SharpZipLib.dll

?????文件????1679360??2018-10-28?05:07??NPOIOffice\NPOIExcel\bin\Debug\NPOI.dll

?????文件?????544768??2018-10-28?05:07??NPOIOffice\NPOIExcel\bin\Debug\NPOI.OOxml.dll

?????文件??????91648??2018-10-28?05:07??NPOIOffice\NPOIExcel\bin\Debug\NPOI.Openxml4Net.dll

?????文件????2128384??2018-10-28?05:07??NPOIOffice\NPOIExcel\bin\Debug\NPOI.OpenxmlFormats.dll

?????文件??????14336??2018-11-20?17:41??NPOIOffice\NPOIExcel\bin\Debug\NPOIExcel.exe

?????文件????????320??2018-11-20?11:30??NPOIOffice\NPOIExcel\bin\Debug\NPOIExcel.exe.config

?????文件??????28160??2018-11-20?17:41??NPOIOffice\NPOIExcel\bin\Debug\NPOIExcel.pdb

?????文件????????203??2018-11-19?17:34??NPOIOffice\NPOIExcel\Class\ExcelHelper.cs

?????文件???????7211??2018-11-20?17:41??NPOIOffice\NPOIExcel\ImportAndExport.cs

?????文件???????5330??2018-11-20?13:09??NPOIOffice\NPOIExcel\ImportAndExport.Designer.cs

?????文件???????5817??2018-11-20?13:09??NPOIOffice\NPOIExcel\ImportAndExport.resx

?????文件????????473??2018-11-20?14:02??NPOIOffice\NPOIExcel\Model\AliIotDeviceInfiModel.cs

?????文件???????5225??2018-11-20?10:54??NPOIOffice\NPOIExcel\NPOIExcel.csproj

?????文件???????1431??2018-11-19?21:26??NPOIOffice\NPOIExcel\obj\Debug\DesignTimeResolveAssemblyReferences.cache

?????文件???????7730??2018-11-20?10:47??NPOIOffice\NPOIExcel\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

?????文件??????????0??2018-11-20?17:41??NPOIOffice\NPOIExcel\obj\Debug\NPOIExcel.csproj.CopyComplete

?????文件?????????42??2018-11-20?10:47??NPOIOffice\NPOIExcel\obj\Debug\NPOIExcel.csproj.CoreCompileInputs.cache

?????文件???????1224??2018-11-20?13:16??NPOIOffice\NPOIExcel\obj\Debug\NPOIExcel.csproj.FileListAbsolute.txt

?????文件???????1022??2018-11-20?13:09??NPOIOffice\NPOIExcel\obj\Debug\NPOIExcel.csproj.GenerateResource.cache

............此處省略88個文件信息

評論

共有 條評論