how to call the calc.exe from c#.net webapp
Hi,
I want to run the calculator.exe file from my c# webapp.I did this by using the hyperlink control and the location of the exe is the navigate url and is working nice.
But it gives the dialog box telling ,'one or more files can harm your computer ...' since it is opening on the IE. if i click the open button the calc.exe is opened.
i want to eliminate /deactivate the asking dialog box and directly open the calculator exe thru c# webapp .
Could u please tell me how can i do that.
Regards
Raghu
Re: how to call the calc.exe from c#.net webapp
Anything that accesses the local system directly is going to be deemed unsafe, even if you're loading an HTML file in the browser off the same system. There's just not anyway around it (ie, would you want it to be able to automatically open format without telling you?)
If you really want a calculator in the browser, the best option is just to find / make a javascript version embedded in the web page. Otherwise, you;ll either have to find an embedded component (meaning web browser plugin / control) or do some pretty nasty stuff with running Winform apps inside of IE.
Re: how to call the calc.exe from c#.net webapp
Quote:
Originally Posted by
devasena_ace
Hi,
I want to run the calculator.exe file from my c# webapp.I did this by using the hyperlink control and the location of the exe is the navigate url and is working nice.
But it gives the dialog box telling ,'one or more files can harm your computer ...' since it is opening on the IE. if i click the open button the calc.exe is opened.
i want to eliminate /deactivate the asking dialog box and directly open the calculator exe thru c# webapp .
Could u please tell me how can i do that.
Regards
Raghu
Hi Raghu,
Put the below code whereever you want to call
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName ="calc.exe";
p.Start();
Hope this will help.
Cheers
Preetham