Click here to Skip to main content
15,909,437 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
shijuse 31-Oct-11 2:10am    
Which methode you need ? like WCF,TCP etc.....
both app1 and app2 are hosted in different server...right?

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
 
Share this answer
 
Comments
Mehdi Gholam 31-Oct-11 0:17am    
They say half of the answer is asking the right question, 5'ed.
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.
 
Share this answer
 
Comments
kami124 20-Sep-11 4:08am    
i have to use the functions of app2 in app1
assamble.loadForm will only display form
Mehdi Gholam 20-Sep-11 4:23am    
Create classes for your functions and then you can use them.
kami124 20-Sep-11 4:57am    
i think u didnt understand my question properly
i have two different applications
app1 has two functions
in app2 i have to use that functions
Sergey Alexandrovich Kryukov 30-Oct-11 20:29pm    
I answered in my solution.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900