部署了dll com作为服务,想在我的VB.net项目中使用 [英] Deployed dll com as service, want to consume in my VB.net project
本文介绍了部署了dll com作为服务,想在我的VB.net项目中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友,
我在VB6中创建了一个dll,并将其添加为VB.Net项目中的参考.它工作正常,没问题.
但是我将dll作为COM管理器中的服务部署在本地计算机中,并且我想将其作为VB.Net项目中的服务使用.
我不知道该怎么办.
我想消耗dll的服务,而无需在我的.Net项目中添加作为参考.
在此先感谢.
Hello friends,
I created a dll in VB6 and added as a reference in VB.Net project. It works fine, no problem.
But i deployed the dll in my local machine as service in com manager and i want to consume as a service in my VB.Net project.
I do not know how to do that.
I want to consume the service of the dll without adding as a reference in my .Net project.
Thanks in advance.
推荐答案
通过谷歌搜索,我发现我们可以在VB.net中创建对象,方法与VB6相同.
我在本地计算机上部署了示例com.
然后我使用代码
致电com.
Through googling, i found that we can create object in VB.net same way as VB6.
I deployed sample com in my local machine.
Then i called the com using the code
addobj = CreateObject("SimpleCalculator.AddNumbers")
我在按钮点击事件中将该函数称为
And i called the function in button click event as
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
val1 = TextBox1.Text
val2 = TextBox2.Text
MsgBox(addobj.add(val1, val2))
End Sub
现在可以正常使用.
Now it works fine.
这篇关于部署了dll com作为服务,想在我的VB.net项目中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文