如何修复委托void system的代码。动作错误?

时间:2016-03-15 16:00:03

标签: asp.net delegates action

这是我的代码

private void try_catch(Action method)
{
    if (method == null) throw new ArgumentNullException("method");
    try
    {
        Connect();
        method();
    }
    catch (SqlException)
    {
        DisConnect();
    }
    catch (Exception)
    {
        DisConnect();
    }
    finally
    {
        DisConnect();
    }
}

这是错误

  

使用泛型类型' System.Action'需要' 1'类型参数

0 个答案:

没有答案