乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 33|回复: 2

简单地将数组写入excel文件

[复制链接]

7

主题

13

帖子

1

银币

初来乍到

Rank: 1

铜币
41
发表于 2015-11-21 10:43:18 | 显示全部楼层 |阅读模式
大家好,
我有一个包含数组的类页面,我有一个包含按钮的表单。当我在表单中预置按钮时,将创建一个excel文件,数组将写入此excel文件。我下载了Excel库。
有人可以帮助我了解基本示例吗?

本帖以下内容被隐藏保护;需要你回复后,才能看到!

游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

7

主题

13

帖子

1

银币

初来乍到

Rank: 1

铜币
41
发表于 2015-11-21 16:33:13 | 显示全部楼层
查看下面的最后一个没有,一旦您发布了一些代码,我们就可以查看,然后我们可以更好地为您提供帮助。
回复

使用道具 举报

7

主题

13

帖子

1

银币

初来乍到

Rank: 1

铜币
41
发表于 2015-11-23 04:55:57 | 显示全部楼层
感谢Keith,
我的简单工作就是为了这条消息
我的课程表的代码是:
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7. using System.Windows.Forms;
  8. using Autodesk.Civil.ApplicationServices;
  9. using acadApp = Autodesk.AutoCAD.ApplicationServices.Application;
  10. using Autodesk.Civil.DatabaseServices;
  11. using Autodesk.Civil.Settings;
  12. using Autodesk.Civil.Runtime;
  13. using Microsoft.Office.Interop.Excel;
  14. using Autodesk.AutoCAD.Runtime;
  15. namespace ClassLibrary9
  16. {
  17.     public class Class1
  18.     {
  19.         public class Commands
  20.         {
  21.             [CommandMethod("WriteToExcel")]
  22.             public void Test()
  23.             {
  24.                 String myString = "E,X,E,R,C,I,S,E";
  25.                 Array myArray = myString.Split();
  26.                 System.Windows.Forms.Application.EnableVisualStyles();
  27.                 System.Windows.Forms.Application.Run(new Form1());
  28.             }
  29.         }
  30.     }
  31. }

表单1的代码是:
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace ClassLibrary9
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.         private void button1_Click(object sender, EventArgs e)
  19.         {
  20.             //Write function to writing myArray to an excel file.
  21.         }
  22.     }
  23. }
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-2-4 21:52 , Processed in 0.202011 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表