【发布时间】:2016-12-18 18:25:23
【问题描述】:
我有两个文件夹,一个文件夹包含文件,另一个文件夹包含 DLL 文件,我不知道 DLL 文件目录中有哪些或多少个 DLL(模块化使用)。 在每个 DLL 文件中都有一个获取 FileInfo 作为参数的函数。 如何在文件目录中的每个文件上运行 DLL 中的所有函数?
例如,其中一个 DLL 文件:
using System;
using System.IO;
namespace DLLTest
{
public class DLLTestClass
{
public bool DLLTestFunction(FileInfo file)
{
return file.Exists;
}
}
}
主要:
DirectoryInfo filesDir = new DirectoryInfo(path_to_files_Directory);
DirectoryInfo dllsDir = new DirectoryInfo(path_to_dlls_Directory);
foreach(FileInfo file in filesDir.getFiles())
{
//How do I run each one of the dll funtions on each one of the files?
}
非常感谢。
【问题讨论】:
标签: c# file dll modularity