CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    4

    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

  2. #2

    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.

  3. #3
    Join Date
    Mar 2011
    Posts
    1

    Re: how to call the calc.exe from c#.net webapp

    Quote Originally Posted by devasena_ace View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured