TypeScript
static void CallFoo(string filename)
{
try
{
string fullFileName = new System.IO.FileInfo(filename).FullName;
Assembly assembly = Assembly.LoadFile( filename );
foreach( Type type in assembly.GetTypes() )
{
MethodInfo foo = type.GetMethod( "foo" );
foo.Invoke(type, new object [] {} );
}
}
catch( Exception e )
{
System.Console.WriteLine("{0}",e);
}
}
Sam HobbsRank #107 · 20.5K reputationPosted Jan 20, 2010, 6:43 PM EST
Note that a DLL must be executed by a exe; whatever you do, there must be an exe to execute the DLL.