asp.net中的vb7中如何调用dll中的函数

/*
豆腐制作,都是精品
http://www.asp888.net 豆腐技术站
如转载 请注明出处
*/
下面我们来看一些 vb7 的简单应用,我们仍然从 hello world 开始

Imports System
Imports System.Runtime.InteropServices

Namespace ClassLibrary1
Public Class Foo
Shared Function

 1<dllimport("user32.dll")> MessageBoxA (ByVal h As Integer, ByVal m As String, ByVal c As String, ByVal type As Integer) As Integer   
 2End Function 
 3
 4Public Shared Sub Main()   
 5MessageBoxA(0, "Hello World2!", "www.asp888.net", 0)   
 6Console.WriteLine("Hello World!!!")   
 7End Sub   
 8End Class   
 9End Namespace 
10
11在这个例子,我们调用了 user.dll 中的 MessageBoxA 的api 函数,这样的方法同样适用与我们自己作的   
12dll中 
13
14作者:豆腐</dllimport("user32.dll")>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus