John Doe
John Doe

Reputation: 183

Load DLL with parameters

I need to delete every single function from my project (VB.Net) and place them in separate DLLs. For example, i have a function that creates a text file and appends text to it. I need a solution that will load my AppendToTextFile.DLL with params just like a function works.

At this time my function accepts two parameters like

AppendToTextFile("C:\test\textFile.txt", "text to be appended")

Does anyone know how to load a custom DLL with params like the function above?

Upvotes: 0

Views: 293

Answers (1)

Al-3sli
Al-3sli

Reputation: 2181

  • Create your custom DLL.
  • Then add it as reference to your project.
  • Call you function and use it like this :

     Dim mydll As New MyCustomeDll
     mydll.AppendToTextFile("C:\test\textFile.txt", "text to be appended")
    

That's all.

Upvotes: 4

Related Questions