Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
533 views
in Technique[技术] by (71.8m points)

vb.net - 如何以编程方式在vb.net(Visual Basic)中导入DLL文件?(How to import DLL file in vb.net(visual basic) programmatically?)

I have 2 files: lib.dll & executor.exe .

(我有2个文件: lib.dllexecutor.exe 。)

lib.dll (lib.dll)

Public Module Module1
   Public Function Abc()
      MsgBox("I am dll")
   End Function
End Module

I want to import lib.dll and use its function in executor.exe .

(我想导入lib.dll并在executor.exe中使用其功能。)
I know lib.dll can be added via visual basic reference ,

(我知道可以通过Visual Basic参考添加lib.dll ,)
But when I place lib.dll in another directory, then it shows errors.

(但是,当我将lib.dll放在另一个目录中时,它将显示错误。)
I want to import dll from a path something like as shown below.

(我想从如下所示的路径导入dll。)

imports "C:Users
ootDesktoplib.dll"
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
       Module1.Abc()
    End Sub
End Class
  ask by Muhammad Ali translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...