孤独是一个人的狂欢。。。
<span style="font-family: Arial, Helvetica, sans-serif;">using System;</span>
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Excel=Microsoft.Office.Interop.Excel;
namespace UserDefinedDataEXP
{
class ExcelDriver
{
private Excel.Application pExcel;
private long curDataColumn;
// Constructor
public ExcelDriver()
{
if (pExcel == null)
{
pExcel = new Excel.Application();
}
curDataColumn = 1;
}
// etc.
public void MakeVisible(bool visible)
{
this.pExcel.Visible=visible;
}
// Reflection
static object SetPropertyInternational(object target, string name, params object[] args)
{
return target.GetType().InvokeMember(name,
System.Reflection.BindingFlags.SetProperty |
System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.Instance,
null, target, args, new System.Globalization.CultureInfo(1033));
}
static object GetPropertyInternational(object target, string name, params object[] args)
{
return target.GetType().InvokeMember(name,
System.Reflection.BindingFlags.GetProperty |
System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.Instance,
null, target, args, new System.Globalization.CultureInfo(1033));
}
static object InvokeMethodInternational(object target, string name, params object[] args)