To Access Notepad, calculator through asp.net

前端 未结 6 852
孤街浪徒
孤街浪徒 2021-01-23 15:47

I m trying to open Notepad, Calculator in button click in asp.net with code behind C#. I tried with the code

 System.Diagnostics.Process.Start(\"c:\\\\windows\\\         


        
6条回答
  •  情歌与酒
    2021-01-23 15:47

    You cannot do this. ASP.NET runs on the server and you cannot run programs on the client computer. The ActiveX object you have shown should work but only in IE and only after the user explicitly authorizes the execution of it. Also the location of notepad.exe might differ depending on the client (could be c:\windows, c:\winnt, ... and some clients running for example on Linux or MacOS don't have such executable)

提交回复
热议问题