如何使用LinqToExcel得到一个Excel文件的工作表名称 [英] How do i use LinqToExcel to get sheet names of an excel file

查看:571
本文介绍了如何使用LinqToExcel得到一个Excel文件的工作表名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用LinqToExcel,我希望能够得到所有表的名称在一个Excel文件,并将它从我的HTML表单的输入进行比较,这样当输入不匹配任何名称的Excel工作表系统会抛出异常。我怎么去有关使用LinqToExcel做到这一点。

I am using LinqToExcel and i want to be able to get the names of all sheets in an excel file and compare it with an input from my html form such that when the input does not match any of the names on the excel sheet the system will throw an exception. How do i go about using LinqToExcel to do this

推荐答案

文件说

的GetWorksheetNames()方法可用于检索工作表名称列表在电子表格

var excel = new ExcelQueryFactory("excelFileName");
var worksheetNames = excel.GetWorksheetNames();

这篇关于如何使用LinqToExcel得到一个Excel文件的工作表名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆