如何在两个应用程序(API)之间交换变量的值? [英] How to exchange values of a variable between two applications (API)?

查看:103
本文介绍了如何在两个应用程序(API)之间交换变量的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找解决问题的方法.

I'm looking for a solution for my problem.

例如:

我有一个名为"App_X"的应用程序.此应用程序的表单(frm_Main)包含以下代码:

I've an application called "App_X". This application has a form (frm_Main) with the following code:

Public Class frm_Main
    Private WithEvents T_Count As Timer = New Timer()
    Private c As Integer = 0

    Private Sub frm_Main_Load(sender As Object, e As EventArgs) Handles Me.Load
        T_Count.Interval = 1000
        T_Count.Start()
    End Sub

    Private Sub T_Count_Tick(sender As Object, e As EventArgs) Handles T_Count.Tick
        c += 1
        Me.lab_CountResult.Text = c
    End Sub
End Class

现在,我有另一个名为"App_Y"的应用程序.由此,我想从"App_X"访问变量c的值.用它做点事.我的计划是建立一个处理交换的dll,这意味着是否有来自"App_Y"的请求. 到dll时,该dll将向"App_X"请求数据.另一种方式是"App_X"正在将变量c的值不断转发到dll和"App_Y",只是从dll中查询值.

Now I have another application called "App_Y". From this I like to access the value of variable c from "App_X" to do something with it. My plan is to build a dll which handles the exchange, means is there a request from "App_Y" to the dll, the dll will request the data from "App_X". Another way would be that "App_X" is forwarding the value of variable c constantly to the dll and "App_Y" is just querying the value from the dll.

我不喜欢将TCP或数据库用于API函数.

I don't like to use TCP or a database for the API function.

是否可以直接从dll访问(到转发的dll)数据以在我的App_Y中使用此数据?

Is there a way to access the (to the dll forwarded) data directly from the dll to use this data in my App_Y?

非常感谢.

以德国的良好问候

塞巴斯蒂安

致谢.

推荐答案

是否可以直接从dll访问(到转发的dll)数据以在App_Y中使用此数据?
Is there a way to access the (to the dll forwarded) data directly from the dll to use this data in my App_Y?

您可能会发现这很有趣:

进程间通信
http://msdn.microsoft.com/en-us/windows/aa365574

-韦恩

You might find this interesting:

Interprocess Communications
http://msdn.microsoft.com/en-us/windows/aa365574

- Wayne


这篇关于如何在两个应用程序(API)之间交换变量的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆