从目录中获取特定命名空间的所有dll

时间:2017-06-22 09:10:43

标签: c# dll directory .net-assembly

有没有办法使用它: Path.Combine(AppDomain.CurrentDomain.BaseDirectory,“bin”) 但按命名空间过滤? 我想要的是目录路径的所有dll具有特定的命名空间

1 个答案:

答案 0 :(得分:0)

使用以下方法加载程序集:

  protected void Delete_Command(object sender, CommandEventArgs e)
    {
        if (e.CommandName.ToString == "Delete") {
            string DeleteRowId = e.CommandArgument.ToString();
            //Call Procedure here to delete row
            ExampleGridview.Datasource=//Call Procedure here to get the datasource again
            ExampleGridView.Databind()
        }
    }

获取所有类型并检查使用的命名空间:

var assembly = Assembly.LoadFrom("path/to/assembly");
相关问题