.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> ASP.NET >> Post New Resource Bookmark and Share   

 Subscribe to Articles

How to call exe from webpage

Posted By:shankey       Posted Date: April 07, 2011    Points: 200    Category: ASP.NET    URL: http://www.dotnetspark.com  

This article will show How to call exe from webpage in asp.net
 

Step1: Create button

Add three buttons, for notepad, calculator and command prompt. Further add style to the button.
 

Step2: Generate Click event of button

Generate Click event for each button.

Step3:Call exe using System.Diagnostics

On the click event of first button place following code

System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\notepad.exe");


On the click event of second button place following code

 System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\calc.exe");

On the click event of third button place following code

System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\cmd.exe");

The start method is used to execute an exe from web page. The start method is a member of Process class which is under  System.Diagnostics name space.

Step4: Click on any button

Clicking on Notepad button will open notepad from the specified path in the click event



Clicking on Calculator button will open Calculator from the specified path in the click event



Clicking on Command Prompt button will open Command Prompt from the specified path in the click event


You can download the belwo code from below link

 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend