Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having one windows application which i am using to take entry from user. I am having one requirement in which i have to develop one web application/web service which will call this windows application and open some windows form and call one function written into it.

I am using asp.net for web service and c#+vb.net for windows application.

Note:- i can't rewrite whole code into asp.net that's why i am looking for such solution.

Let me explain it. I don't want to run my application on client end. I am having webservice/web application installed in server, and having windows application on same server too. User will request to execute windows application from client system and this webservice should run that windows application on server only. For my case use want to authorize any process so that it move forward, code for this is written in windows application, now user wants output of this process execution.

I will manage authentication at my end currently i am stuck to open windows application and access any form through asp.net.

What I have tried:

I don't know what to do and how to do,so i didn't tried any thing yet. I need some guidance of topic to move forward.
Posted
Updated 1-Sep-16 22:26pm
v3
Comments
NaibedyaKar 2-Sep-16 6:33am    
Why do you want to call the windows application form the web. Can't you do the same thing using the webservice code.
Alok Chandra Shahi 2-Sep-16 7:08am    
It is not small application,to rewrite whole code will take lots of time. For which my company and team is not ready. I could be same as distributed application.

1 solution

You cannot run an application on a client machine from a server: that is absolutely a forbidden action from a security point of view. The interaction (and the application) must be started by the user on the client and request actions from the server, not the other way round.

Think about it: if your server could run an app on your PC so could malicious sites. Want to visit a site that runs a ransomware app on your PC without you doing anything? Becaue I don't...
 
Share this answer
 
Comments
Alok Chandra Shahi 2-Sep-16 4:26am    
Let me explain it. I don't want to run my application on client end. I am having webservice/web application installed in server, and having windows application on same server too. User will request to execute windows application from client system and this webservice should run that windows application on server only. For my case use want to authorize any process so that it move forward, code for this is written in windows application, now user wants output of this process execution.

I will manage authentication at my end currently i am stuck to open windows application and access any form through asp.net.
OriginalGriff 2-Sep-16 4:31am    
OK - running a "Windows application" on the server from the client isn't difficult at all - calling Process.Start from your website / webservice code will do it providing the hosting service hasn't shut that down - but getting output to you user is trickier, depending on exactly what output you want to show. Are you talking about the actual form appearing in the client browser? Or about the application output file(s)?
Remember, we can't see your screen - all we get to work form is exactly what you type so we have no context for your query beyond that.
Alok Chandra Shahi 2-Sep-16 6:34am    
I am having one windows application in which i am having 100 forms (Windows Form), each form is used to take some entry from user. There is one concept "authorization" of entry entry. When ever user authorize any entry from these forms we do some calculation.These authorization is done by higher management of organization. Now i am developing one web application for authorization of entries done by user. For this i don't want to rewrite whole code again. My query is that- is it possible to
1. open an exe (as my windows application is build as executable)
2. then open specific form (it may be form1 or form2 as per requirement) with in it.
3. execute any function written into it (which will return some value)
4. and close the application.

will process.start work upto that level, because opening an application won't solve my problem.

I don't bother whether this form will visible to any one or not. Client is just sending request to authorize any entry (entry of any form,which is known to user).
OriginalGriff 2-Sep-16 6:55am    
Probably, yes - you can send "keystrokes" to an application provided it's teh "foreground application", which you can make it become: http://stackoverflow.com/questions/2744111/sending-keystrokes-to-a-program
But...in a web context? Bad idea, because you are potentially going to be having several different user trying to do the same thing at the same time, and it'll get confused. And in addition, it's going to depend on *how* the form / app does the "return some value" bit as well.
To be honest, I'd have to say that though you *can* do it, you probably shouldn't because it's going to cause you intermittent problems in production that are probably impossible to fix.
If you can re-write the windows app to use command line instructions instead, then it's a lot more reliable. Or better, include the code in your web service directly.
Alok Chandra Shahi 2-Sep-16 7:06am    
I appreciate your suggestion to rewrite the whole code,but authorization is a separate project which may take more then 1 year to redevelop. And currently my team and company is not ready for it.

I don't need any keystroke. As i explained earlier that all the entries has been done by end user,i just want to authorize this entry (for which i have written one function {lets say authorize} in each form). I want to open any form and call "Load" function which will fill the entries done by user for any entry and after this i want to call this authorize function. and this function will return me either true or false to know the status of execution.

is there any possibility now

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