当前注册人数423093人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB Android   站内搜索 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

Excel Reader

纯C#代码的Excel读取源代码

2007年12月08日
C# 2.0, Windows, .NET 2.0, VS, Dev
本代码使用纯C#编写,不需要Office Excel Com组件的支持,它的功能包括: 读出在工作簿(workbook)中的所有Worksheet,读出所有WorkSheet中的单元,读取单元的内容(文本,数字,日期或错误),读取单元的格式(字体,对齐,线条类型,背景等),够读取文件中的图片,获取图象的大小,位置,数据和格式
相关知识

代码使用

1. 打开文件

Stream fileStream = File.OpenRead(file);
Workbook book = new Workbook();
book.Open(fileStream);
Worksheet sheet = book.Worksheets[0];



2. 读取单元

int row = 1;
int col = 0;
string ID = sheet.Cells[row, col].StringValue;

Picture pic = sheet.ExtractPicture(row, col);
源代码原文下载:
Excel Reader * It can read read worksheets in a workbook and read cells in a worksheet. * It can read cell content (text, number, datetime, or error) and cell format (font, alignment, linestyle, background, etc.). * It can read pictures in the file, get information of image size, position, data, and format.

源码图片

点击链接查看大图
从本站下载附件及源代码(1个附件,已经成功下载2237次)

最值得关注的外文源代码

Clog - Client Logging, WPF Edition
How to read MS Excel 2007 using a connection string in C#
CHttpClient - A Helper Class Using WinInet
Reader of SWF header file in pure C#
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论275次,此处显示最近20次评论! 查看所有评论

wgy起飞  2021年08月28日
zg  2021年08月28日
chr78228  2020年12月15日
谢谢分享 刚开始学
jim5488  2018年06月11日
very good
cgb321  2017年07月20日
现在真的想看一下代码是什么样的
shlucky  2017年04月18日
不错,如果能实现向写入的数据保存到Excel就完美了。
aff  2016年11月14日
没积分了,存点积分下载下来看看。
0o清风o0  2016年07月14日
现在真的想看一下代码是什么样的
horatio-j  2016年05月25日
很好
woshinigumadedaye  2016年03月25日
haikeyi
fuzi  2016年03月02日
现在真的想看一下代码是什么样的
ygtjcng1  2014年11月10日
谢谢
小吉  2014年11月07日
简单的程序,功能很强大
dd  2014年10月28日
确实不错
myhero009  2014年10月13日
谢谢
yuhuiran  2014年08月18日
学习学习
ha1234  2014年08月14日
看看怎麼弄的
dos_119  2014年04月13日
先看看
gorsen  2014年04月10日
我22积分,下载的时候提示积分不够。
淡淡情伤  2014年04月04日
新用户,下载不了,麻烦朋友们传一份,630547510@qq.com
字数在300字内
请如实评论
200万国内源码搜索
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved zhihuishi   免责声明