Q
数据交换应用
0
A
回答
0
OK的地方,在VB中需要实现两个程序之间的接口,因此您可以在它们之间传递参数。
- 记得导入 “系统” 和 “的System.Reflection”
在程序1(调用程序),我设置了:
Dim oType As System.Type
Dim oAssembly As System.Reflection.Assembly
Dim oObject As System.Object
oAssembly = Reflection.Assembly.LoadFrom("C:\VB.NET\report3.exe")
oType = oAssembly.GetType("report3.r1") ' this is [root_namespace.class name]
oObject = Activator.CreateInstance(oType)
oObject.SetParams("a", "b")
oObject.show()
这将导致report3.exe运行并将其作为值发送给“a”和“b”参数。
然后在程序2(report3.exe),我把它像这样:
Imports System.Reflection
Public Class r1
Implements IPlugin
Public person As String = ""
Public address As String = ""
Private Sub r1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.TopMost = True 'optional
Dim b1 As New Label()
With b1
.Location = New Point(10, 10)
.Width = 200
.Height = 20
.Parent = Me
.BackColor = Color.Blue
.ForeColor = Color.White
.Text = person
End With
call_addr()
End Sub
Public Sub SetParams(c As String, d As String) Implements IPlugin.SetParams
person = c
address = d
End Sub
Private Sub call_addr()
Dim b2 As New Label()
With b2
.Location = New Point(10, 50)
.Width = 200
.Height = 20
.Parent = Me
.BackColor = Color.Red
.text = address
End With
End Sub
End Class
Public Interface IPlugin
Sub SetParams(ByVal c As String, ByVal d As String)
End Interface
+0
好的,谢谢! –
0
我可以看到那里正在并发症使用C++及VB,但这里的开始 http://msdn.microsoft.com/en-us/library/aa365574%28VS.85%29.aspx
相关问题
- 1. Clojure应用程序数据交换
- 2. 数据交换
- 3. 交换数据
- 4. 交换数据
- 5. 交换数据
- 6. 交换数据
- 7. 使用iframe来交叉数据交换
- 8. Bootstrap数据交换?
- 9. UIPopover和UITableView数据交换
- 10. Datatel/colleage数据交换
- 11. 交换数据php javascript
- 12. 交换数据AngularJS电话
- 13. MFC数据交换验证
- 14. QT线程交换数据
- 15. Indy TIdTCPServer TIdTCPClient数据交换
- 16. 的NodeJS数据交换
- 17. 交换数据 - DI,IoC的
- 18. 交换数据库php activerecord
- 19. Informatica B2B数据交换
- 20. 数据交换标准
- 21. Python的数据交换?
- 22. 从网络交换数据
- 23. 交换数据库问题
- 24. 如何在两个python应用程序之间交换数据?
- 25. 如何处理跨应用程序域数据交换
- 26. C++应用程序(Sci)之间的数据交换Python
- 27. 在iOS应用程序之间交换数据
- 28. R和Windows应用程序之间的实时数据交换
- 29. 通过ActiveSync在应用程序之间进行数据交换
- 30. Android应用程序中的WebView数据交换
你的两个程序之间传递数据或者是那里的数据存储就像一个数据库的地方,他们都可以读取?是一个程序调用另一个程序吗?他们是否都在同时运行,并且彼此“交谈”? – user2721815
没有数据库,是第二个调用另一个,两个同时运行 –
我已经在VB中使用一个接口完成了这个。我不知道你是否可以在C中做同样的事情。 – user2721815