Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
Hello i have added following code in my web application
protected void Page_Load(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("Notepad.exe");
        }


as an example i am using notepad.exe , actually i want any exe to open from webpage.

this application works correctly in visual studio but when i am hosting this on IIS the exe doesnt open please help as i have tried every link possible on google

i need to implement this functionality please suggest ways to achieve it
Posted

Web code runs on the server. So, the code you have will attempt to launch NotePad on the server. It works when you do it in development because your machine is the server. I think you need to rethink what you are trying to accomplish with web code.
 
Share this answer
 
You have to go back and learn about web applications...
Web - by its nature - is a disconnected application, where the two parts of the application exists and active in an exclusive way...
It means that when the server active the client not and when the client active the server not...
The code you presented here belongs to the server part, and for that it opens the notepad.exe on the server!!! Even you had the proper rights (it is possible to give it) notepad would open on the server, where no one looks at!
Follow these steps:
1. Learn and understand the nature of a web application
2. Focus on client side security restrictions (those restrictions can not be removed)
3. Identify the functionality of your web page and find a solution
 
Share this answer
 
Comments
Member 10527204 28-Jul-15 7:25am    
@kornfeld i appreciate your quick and valuable response and i will work on it.
but for now is there any way to achieve that kind of functionality
viz : launch exe from your web application and get the desired results
Kornfeld Eliyahu Peter 28-Jul-15 7:27am    
In one word: no...
With more details: You MUST learn the platform you develop for! Without the most basic understanding of the platform you can not develop...
F-ES Sitecore 28-Jul-15 7:28am    
No there isn't. If webpages could start processes on the client it would be a security nightmare. It doesn't matter how much you want something, some things just aren't possible.
Member 10527204 28-Jul-15 7:28am    
all right thanks

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