111,039
社区成员
发帖
与我相关
我的任务
分享
public delegate void dDoExcel();
public event dDoExcel DoExcel; //完成事件
public delegate void dThrowErr();
public event dThrowErr ThrowErr; //出错事件
public void Excel(string excelPath)
{
try
{
//....做你要做的关于Excel操作的事情
if (DoExcel != null)
{
foreach (dDoExcel de in DoExcel.GetInvocationList())
{
de.Invoke();
}
}
}
catch
{
if (ThrowErr != null)
{
foreach (dThrowErr te in ThrowErr.GetInvocationList())
{
te.Invoke();
}
}
}
}