Launch Dll using C# program

前端 未结 9 759
你的背包
你的背包 2021-01-06 08:52

I have a C# form application...i created a Dll...now i want to launch that dll using this program. how do i do it?

#include 

typedef int (*         


        
相关标签:
9条回答
  • 2021-01-06 09:11

    You can use different methods, one is

    Assembly.Load 
    

    another is using a DllImport attribute:

    [DllImport("mylib.dll)]
    
    0 讨论(0)
  • 2021-01-06 09:15

    You could do this for an exe:

       Process.Start("yourProcess");
    

    You could also use the AppDomain object if you want to load a dll into your process and then consume it.

    And finally you can use the

      Assembly.Load(...) 
    

    Each serves its own purpose and I would suggest to read up on all of them on msdn for starters.

    0 讨论(0)
  • 2021-01-06 09:19

    I assume you want to use the functionality of the DLL? If so, create a reference to the DLL and consume it in your C# forms application. In other words, create a "user" interface for application logic contained in a DLL. If this does not make sense, you should look up how to add a reference to a project.

    0 讨论(0)
提交回复
热议问题