저는 현재 .NET 및 C#을 연구 중이므로 매우 익숙하므로 서버와 클라이언트로 '연락처 북'을 만들어야합니다. 나는 다음과 같은이 연락 책을 사용할 수있는 작업을 설명하는 서버에서 사용하는 인터페이스 생성 : 내 클라이언트에서 해당 인터페이스의 .DLL를 참조하는 데 사용어셈블리에서 인터페이스를로드하고 해당 메서드를 사용하십시오.
bool AjouterContact(string num, string nom, string prenom, string mail, string telephone);
bool SupprimerContact(string num);
bool ModifierContact(string num, string nom, string prenom, string mail, string telephone);
List<string[]> RecupererContacts();
을하고 그것을 잘 작동했지만 지금은 필요 이 .dll을 모두 동적으로로드하려면 이것은 내가하고있는 것입니다 :
Assembly a = Assembly.LoadFrom("../../../RemotingInterfaces/bin/Debug/RemotingInterfaces.dll");
Module[] modules = a.GetModules();
Module module = modules[0];
Type[] types = module.GetTypes();
foreach (Type type in types)
{
Console.WriteLine(" Le type {0} a cette (ces) methode (s) : ", type.Name);
Console.WriteLine("Type information for:" + type.FullName);
Console.WriteLine("\tIs Class = " + type.IsClass);
Console.WriteLine("\tIs Enum = " + type.IsEnum);
Console.WriteLine("\tAttributes = " + type.Attributes);
MethodInfo[] mInfo = type.GetMethods();
foreach (MethodInfo mi in mInfo)
Console.WriteLine(" {0}", mi);
}
이것은 작동하고 모든 방법을 콘솔에 씁니다. 하지만이 방법을 사용하는 방법을 알고 싶습니다.
나는 충분히 명확했으면 좋겠다. 다시 말하지만 .NET과 C#을 처음 사용하기 때문에 실제로 어떻게 작동하는지 잘 모릅니다.
나는이 방법을 시도하고 그것이 어떻게되었는지 알려줄 것이다. 고맙습니다. –
이것이 내가 필요한 방법이다. 고마워. –
신난다, 도와 줘서 기뻐 :) – wsanville