c#操作EXCEL(读取sheet名,不排序)
来源:互联网 发布:网络直播唱痒的女的 编辑:程序博客网 时间:2024/05/22 00:47
private const long BUFFER_SIZE = 4096;
private string m_ZipFilePath;
public string ZipFilePath
{
get { return m_ZipFilePath; }
set { m_ZipFilePath = value; }
}
private string m_OutZipFilePath;
public string OutZipFilePath
{
get { return m_OutZipFilePath; }
set { m_OutZipFilePath = value; }
}
private FileInfo fileInfo;
private string zipFilePath;
public List<string> GetExcelSheetName(string filePath)
{
GetZipFilePath(filePath);
//将excel文件,复制成.zip文件
FileInfo newFileInfo = fileInfo.CopyTo(m_ZipFilePath, true);
Decompress(m_ZipFilePath, m_OutZipFilePath);//解压zip
List<string> ExcelSheetNameList = GetSheetNameByXml(m_OutZipFilePath);
//获取文件名后删除解压后的文件及.zip文件
DeleteFile();
return ExcelSheetNameList;
}
/// <summary>
/// 获取生成的zip文件的路径 及解压后的路径
/// </summary>
/// <param name="filePath">Excel文件路径</param>
public void GetZipFilePath(string filePath)
{
fileInfo = new FileInfo(filePath);
zipFilePath = ProjectFileManager.Instance().CurrentProjectLossPath;//zip文件及解压后的文件存放的路径
string fileName = Path.GetFileNameWithoutExtension(filePath) + ".zip";
m_ZipFilePath = zipFilePath + "\\" + fileName;
m_OutZipFilePath = Path.Combine(zipFilePath, fileInfo.Name.Substring(0, fileInfo.Name.Length - 4));
}
- c#操作EXCEL(读取sheet名,不排序)
- C#获取Excel里sheet名
- C# 操作Excel ---复制Excel的sheet
- C#读取Excel多个sheet
- C#读取Excel多个sheet
- C#读取 excel中的表名sheet名不是默认的sheet1,shee2就取不到值了 c# 如何读取自定义的sheet值?c#读取excel最佳解决方案
- C# 操作excel多个sheet
- C#操作Excel(读取)
- C#操作Excel(读取)
- C#操作Excel(读取)
- C# 读取Excel中指定的Sheet名称或索引
- C# 读取Excel中指定的Sheet名称或索引
- C# 读取Excel中指定的Sheet名称或索引
- C# 读取Excel中指定的Sheet名称或索引
- c#读取Excel的第一个Sheet表
- c#读取Excel的第一个Sheet表
- C# 读取Excel中指定的Sheet名称或索引
- C# 读取 excel 中 sheet 及数据到DataTable
- OURS+CORTEX+A8DB开发板eboot下DM9000功能实现手记
- sql2005性能优化(在32位系统上突破2G内存使用量的方法)
- 『这辈子就相爱《何苦要等下辈子》 李草青青、肖玄MV』
- 脚本改变生活(二)
- BoxOver.js 漂亮的Title效果 ,应用时效果失效解决办法
- c#操作EXCEL(读取sheet名,不排序)
- 远程连接ORACLE服务的设置方法
- 播放基于流媒体服务器的视频,本例基于 RED5
- Ubuntu下安装SDL
- 11G数据库导入10G的操作实践
- 那些日子
- WM_COPYDATA
- 源代码网站
- CString 操作指南