Hello everybody. i am new in this forum and hope you could help me. i have a project that i have to do that uses a physical device. the device and his dll may be vary. therefore i have an interface that wrapped the dll of the device. i need to search within the dll library and load the right dll file and import it.
this is what i got so far:
//list of all dll files in the drivers folder (and subfolder) string[] dlls = Directory.GetFiles(@"..\..\..\\drivers", "*.dll", SearchOption.AllDirectories);
// Seeking for device wrapper with reflection foreach (string dll in dlls) { try { string fullFileName = new FileInfo(dll).FullName; textBox2.Text = fullFileName.ToString(); Assembly assembly = Assembly.LoadFile(fullFileName); } catch (Exception ex) { continue; }
i have to see if the dll is the right dll for this specific device. how do i do it and how do i import it?