当前位置:首页 > 网络编程 > 软件语言 > .NET > asp.net中的vb7中如何调用dll中的函数

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

点击次数:80 次 发布日期:2008-11-06 07:51:12 作者:源代码网
源代码网推荐
广告载入中
下面我们来看一些 vb7 的简单应用,我们仍然从 hello world 开始

源代码网整理以下

源代码网整理以下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

源代码网整理以下在这个例子,我们调用了 user.dll 中的 MessageBoxA 的api 函数,这样的方法同样适用与我们自己作的
dll中


源代码网推荐

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华