using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        RWExcel rwExcel = new RWExcel(strFileName);
         public Form1()
        {
            InitializeComponent();
        }
                
        private void Form1_Load(object sender, EventArgs e)
        {        }        private void button2_Click(object sender, EventArgs e)
        {
           
            rwExcel.GetAndWrite(strFileName, strDesPath);
        }        private void button1_Click(object sender, EventArgs e)
        {               rwExcel.GetExcelName();
        }        private void button3_Click(object sender, EventArgs e)
        {
            rwExcel.ExportExcel(filepath, newname);
        }
    }
}
如何声明函数里的参数啊。。求助啊 

解决方案 »

  1.   

    string strFileName="你要设置的值";//注意类型对应
    RWExcel rwExcel = new RWExcel(strFileName);
      

  2.   

    string strFileName = "xxxx";
    RWExcel rwExcel = new RWExcel(strFileName);
      

  3.   


    能不能把下面几个声明也写出来呢。。我这照猫画虎也不会啊
    鼓弄半天了。。
    strDesPath    filepath   newname 这三个
    还有运行时候报错哩。
    字段初始值设定项无法引用非静态字段、方法或属性“WindowsFormsApplication1.Form1.strFileName”