datagridview导出为excel文件的C#实例 急!

来源:百度知道 编辑:UC知道 时间:2024/06/30 09:40:12
如题 寻求datagridview导出为excel文件的C#实例源代码!

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data;
using System.Windows.Forms;
using Microsoft.Office.Interop.Excel;

namespace AssetsManage.Operation
{
class Export
{
private static System.Windows.Forms.DataGridView gridView;
private static System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1;
private static Timer time;
private static DataSet objSet = new DataSet();
private static SaveFileDialog saveFileDialog = new SaveFileDialog();
private static SaveFileDialog saveFileDialog2 = new SaveFileDialog();

public static System.Windows.Forms.DataGridView _gridView
{
get { return gridView; }
set { gridView = value;}
}
public static System.Windows.Forms.ToolStripProgressBar _toolStripProgressBar1