从其他应用程序访问功能 [英] accessing function from other application

查看:123
本文介绍了从其他应用程序访问功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我有两个应用程序都在c Sharp 4.0中
app1
app2

app1具有不同的功能

在app2中,我想从app1中访问功能
或者我想从app2中的app1检索证书值

您能帮我怎么做吗

hi to all!

i have two applications both are in c sharp 4.0
app1
app2

app1 has different functions

in app2 i want to access the functions from app1
or i want to retrive certian values from app1 in app2

can u help me how to do

推荐答案

只引用另一个程序集.在VS中,您可以通过添加引用"来实现.通常,将引用DLL,但是您也可以引用EXE.本质上,EXE和DLL之间没有严重的区别. EXE有入口点,那又如何呢?您需要将要在程序集外部使用的类型,方法和属性声明为public.

—SA
Just reference one assembly by another. In VS, you do it by "add reference". Normally, a DLL is referenced, but you can reference EXE as well. Essentially, there are no serious difference between EXE and DLL. EXE has entry point, so what? You need to declare types, methods and properties to be used outside the assembly as public.

—SA


要在另一个应用程序中使用功能,您可以Assembly.LoadFrom该应用程序并使用内部公开的类.

要访问另一个应用程序中正在运行的数据,您必须在TCP,WCF等中设置某种通信链接.
To use functions in another app you can Assembly.LoadFrom the app and use the classes inside provided they are public.

To access running data in another app you have to setup some kind of communication link either in TCP, WCF, etc.


这篇关于从其他应用程序访问功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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