locked
Open Windows Calculator onClick RRS feed

  • Question

  • User-981963818 posted

    I want to open Calc.exe with a button on my page. This was discussed here: http://forums.asp.net/t/1367465.aspx/1, but I would like to use Razor to do it. 

    The below works to open the calculator, but I want it to open it at the click of a button and not on page load.

    System.Diagnostics.Process.Start("calc.exe");

    Any thoughts on how this would be done with Razor?

    Thanks for any suggestions.

    Monday, June 3, 2013 1:51 PM

Answers

  • User-821857111 posted

    Are you saying that it will not work when the site is placed on the actual server?
    Correct. The code executes on the server, so it will try to open calc.exe on the server. When you run the site locally, your local machine is the both client and server which is why you see calc.exe opening. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 4, 2013 8:18 AM

All replies

  • User-821857111 posted

    That code will open Calculator on the server. You cannot open programs on the client using ASP.NET.

    Monday, June 3, 2013 3:03 PM
  • User-981963818 posted

    Hello.

    I am slightly confused at your response. That code open the calculator on my computer running a local site.

    Are you saying that it will not work when the site is placed on the actual server? Would it make a difference that it would be more of an intranet?

    Thanks.

    Tuesday, June 4, 2013 7:58 AM
  • User-821857111 posted

    Are you saying that it will not work when the site is placed on the actual server?
    Correct. The code executes on the server, so it will try to open calc.exe on the server. When you run the site locally, your local machine is the both client and server which is why you see calc.exe opening. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 4, 2013 8:18 AM
  • User-981963818 posted

    I understand now. Thanks for your help.

    Tuesday, June 4, 2013 8:32 AM