这是DLL的语句
Public Class Class1
Public Function autha(ByVal rc As String) As String
Dim es As New ServiceReference1.authRequest
Dim sd As New ServiceReference1.authRequestBody
sd.access = rc
es.Body = sd
Dim web As ServiceReference1.Hoslink
Dim cc As String = web.auth(es).ToString
Return cc
End Function
End Class
全局代码
Public Declare Function Auth Lib "ClassLibrary2.dll" Alias "autha" (ByVal rc As String) As String
ClassLibrary2.dll从哪来的?使用vs开发的?
和vs里的用法完全一样的,加上命名空间引用类型即可
dim a as new dll的命名空间.Class1
dim b as string = a.autha("xxx")
msgbox(b)
解决了,感谢蓝老师
[此贴子已经被作者于2023/12/18 9:15:13编辑过]