如何在c#窗体中从其他应用程序创建一个正在运行的应用程序的对象? [英] how to create object of one running application from other aplication in c# window form ?

查看:74
本文介绍了如何在c#窗体中从其他应用程序创建一个正在运行的应用程序的对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有两个窗口应用程序。申请a和b。现在应用程序有一些数据,如用户名,公司代码等。我想要做的是我想从应用程序b创建应用程序对象,并希望访问用户名和公司代码到应用程序b。可能吗?我知道我们可以在c#中创建一个excel对象,同样我们也可以创建其他应用程序的对象。还有





VB的Createobject方法做同样的我猜但不确定我们是否可以在c#中使用类似的东西?

Hi all ,

i have two window application. application a and b. now application a have some data like username , companycode etc. what i want to do is i want to create an object of application a from application b and want to access the username and company code to application b. is it possible? i know we can create an object of excel in c# ,same way can we create object of other application as well. also


VB's Createobject method do the same i guess but not sure if we can use something similar in c# ?

推荐答案

Excel 是一个 COM 自动化服务器。

虽然您可以实际修改您的应用程序以使其成为 COM 自动化服务器,但我建议您使用另一种(可能更简单) IPC
Excel is a COM automation server.
While you can actually modify your application in order to make it a COM automation server too, I would suggest you to use another (might be simpler) form of IPC.


You can write user username and company to text file and access this file from application b.
Hope this will helps you.


这篇关于如何在c#窗体中从其他应用程序创建一个正在运行的应用程序的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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