当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > asp.net中的vb7中如何调用dll中的函数

ASP.NET
HTML服务器控件介绍:HtmlInputFile控件
HTML服务器控件介绍:HtmlInputHidden控件
HTML服务器控件介绍:HtmlInputImage控件
HTML服务器控件介绍:HtmlInputRadioButton控件
HTML服务器控件介绍:HtmlInputText控件
HTML服务器控件介绍:HtmlSelect控件
HTML服务器控件介绍:HtmlTable控件
HTML服务器控件介绍:HtmlTableCell控件
HTML服务器控件介绍:HtmlTableRow控件
HTML服务器控件介绍:HtmlTextArea控件
Web服务器控件:AdRotator控件
Web服务器控件:Button控件
Web服务器控件:Calendar控件
Web服务器控件:CheckBox控件
Web服务器控件:CheckBoxList控件
Web服务器控件:DropDownList控件
Web服务器控件:HyperLink控件
Web服务器控件:Image控件
Web服务器控件:ImageButton控件
Web服务器控件:Label控件

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 68 ::
收藏到网摘: n/a

/*
豆腐制作,都是精品
http://www.asp888.net 豆腐技术站
如转载 请注明出处
*/
下面我们来看一些 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中

作者:豆腐