19 lines
1.8 KiB
HTML
19 lines
1.8 KiB
HTML
<div>下载地址为:http://npoi.codeplex.com/releases/view/616131</div>
|
||
<div>可以操作excel表,行,单元格内家及样式等。</div>
|
||
<div> </div>
|
||
<div>使用示例:</div>
|
||
<div>
|
||
<div> using (FileStream fs = File.OpenRead(@"E:\a.xls")) //打开myxls.xls文件</div>
|
||
<div> {</div>
|
||
<div> HSSFWorkbook wk = new HSSFWorkbook(fs); //把xls文件中的数据写入wk中</div>
|
||
<div> wk.RemoveSheetAt(0);</div>
|
||
<div> </div>
|
||
<div> using (FileStream fileHSSF = new FileStream(@"E:\a.xls", FileMode.Create))</div>
|
||
<div> {</div>
|
||
<div> wk.Write(fileHSSF);</div>
|
||
<div> fileHSSF.Close();</div>
|
||
<div> }</div>
|
||
<div> wk.Close();</div>
|
||
<div> fs.Close();</div>
|
||
<div> }</div>
|
||
</div> |