The Artima Developer Community
Sponsored Link

C# Answers Forum
yet another dll import question

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
leon pro

Posts: 1
Nickname: leonpro
Registered: Jun, 2009

yet another dll import question Posted: Jun 16, 2009 6:48 AM
Reply to this message Reply
Advertisement
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?

thank you

Topic: Assembly Registration - C# Beginner Previous Topic   Next Topic Topic: StreamReader Variable

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use