Hi
Here code for you
public static Object
GetReferenceFromClass(string AssemblyName, string ClassName, object[]
args)
{
Assembly
assembly = Assembly.LoadFrom(AssemblyName);
foreach
(Type type in
assembly.GetTypes())
{
if
(type.IsClass == true)
{
if
(type.FullName.EndsWith("." +
ClassName))
{
ConstructorInfo[] con =
type.GetConstructors();
foreach (ConstructorInfo
construtor in con)
{
if (construtor.GetParameters().Length == args.Length)
{
return construtor.Invoke(args);
}
}
}
}
}
throw
(new System.Exception("could
not create instanace----->" +
ClassName));
}
Thank you