C#读写Excel的方式有好几种,具体参考文章:

http://www.cnblogs.com/huipengkankan/archive/2011/07/28/2120407.html

昨天大致研究了一下,项目中使用LibXl库进行读写,官方网址:http://libxl.com/home.html,可以支持C#\C++\Delphi\Fortran等等,新版可以支持到Excel2013,用起来还是蛮方便的,但是要购买。

破解的也有,可以参考:http://blog.csdn.net/lbd2008/article/details/8332345

里面的函数不多,可以直接参考官方文档,或者看下百度文库

 

官方小例子:

class Program
{ 
    static void Main(string[] args)
    {
        try 
        {
            Book book = new BinBook(); // use XmlBook() for xlsx
            Sheet sheet = book.addSheet("Sheet1");
            sheet.writeStr(2, 1, "Hello, World !");
            sheet.writeNum(3, 1, 1000);
            book.save("example.xls");    
        }
        catch (System.Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }
}

相关文章:

  • 2021-12-28
  • 2021-12-04
  • 2021-09-13
  • 2022-02-12
猜你喜欢
  • 2022-12-23
  • 2021-11-18
  • 2021-08-12
  • 2021-04-26
  • 2022-01-30
  • 2021-12-12
  • 2021-07-19
相关资源
相似解决方案