C # dll noob how to get functions

I was given a dll to talk to the device, I have little experience with C #, and I should get the device initialized by the end of the week. The dll has methods for opening ports and sending messages, but I have no idea how to access the functions

I know that it’s a little ridiculous to ask him, but I don’t have enough time. Thank,

+3
source share
5 answers
  • Add Link to .dll file in C # project.
  • Add space using usage at the top of any class that will interact with .dll methods.

Now you can access the methods.

: , Pinvoke.

+6

, ( , DLL) P/Invoke static extern .

+2

DLL ( , ), . , , , :)

+1

DLL .Net, Visual Studio, .

.NET Reflector, , .

0

1- If Dll is controlled, that is, writing using a .net structure than calling a method from a dll, it looks like you are calling a method from your own class.

just add the link to the DLL in your project and include the namespace link using the "Use" keyword.

2- If it is not, you need to dynamically import your dll, you can use [DllImport]

0
source

Source: https://habr.com/ru/post/1779193/


All Articles