110,825
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
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();
}
}
}
}