直播中
Imports System
Imports System.Runtime.InteropServices
Namespace ClassLibrary1
Public Class Foo
Shared Function <DllImport("user32.dll")> MessageBoxA (ByVal h As Integer, ByVal m As String, ByVal c As String, ByVal type As Integer) As Integer
End Function
Public Shared Sub Main()
MessageBoxA(0, "Hello World2!", "www.asp888.net", 0)
Console.WriteLine("Hello World!!!")
End Sub
End Class
End Namespace
在這個(gè)例子,我們調(diào)用了 user.dll 中的 MessageBoxA 的api 函數(shù),這樣的方法同樣適用與我們自己作的
dll中