mshtml & web browser from dotnet service

Discussion in 'ASP .Net Security' started by NG, Dec 2, 2005.

  1. NG

    NG Guest

    Hi All
    This is a post further to my previous problem that I solved with the help of
    my friends at csharp group.

    I have a UI application that has a web-browser. When this application is
    run with the URL as one of the command parameters, this application accesses
    the web page in its web browser and parses the data of this web-site to get
    the specific information this app is interested in. This application works
    perfectly when run from a command prompt or a batch file. (I know I don't
    have to use web browser control and mshtml is enough for most purposes.
    But, in my case IT IS required.)

    However, now I needed to invoke the same application from csharp windows
    service. I made the service property to be able to interact with desktop.
    The service perfectly opens the application and I can see the application
    running on my desktop.

    System.Diagnostics.Process p=new System.Diagnostics.Process();
    p.StartInfo.FileName="notepad.exe"; // my app is run instead
    bool x=p.Start();

    Now the problem is the web-browser is not able to open the web page that I
    am looking for. It always returns the error page saying:

    Internet Explorer was unable to link to the web page you requested. The
    page might be temporarily unavailable.......

    I found on the net that this error occurs when the site has been requested
    and then the request is cancelled immediately.

    I am not sure but this has something to do with windows service security?
    Is the service making the download to stop/cancel the web-request?

    Can anyone please throw some light on the cause of the problem.

    Any help is much appreciated.

    Thanks & regards,
    NG, Dec 2, 2005
    1. Advertising

  2. "NG" <xgniteshATyahooDOTcom> wrote in message
    > However, now I needed to invoke the same application from csharp
    > windows service.

    A service running under Local System account (the default) does not have
    any networking capabilities, for security reasons. Create a dedicated
    user account for it, configure it to run under that account.
    With best wishes,
    Igor Tandetnik

    With sufficient thrust, pigs fly just fine. However, this is not
    necessarily a good idea. It is hard to be sure where they are going to
    land, and it could be dangerous sitting under them as they fly
    overhead. -- RFC 1925
    Igor Tandetnik, Dec 2, 2005
    1. Advertising

  3. NG

    NG Guest

    Thanks for your help Igor.
    My program works perfectly when I run from a different user account.
    Best Regards,
    Nitesh Gupta
    NG, Dec 5, 2005
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Dec 8, 2004
  2. SpamProof
    Oct 21, 2003
  3. DotNetShadow

    MSHTML web application SLOW

    DotNetShadow, Nov 18, 2003, in forum: ASP .Net
    Nov 19, 2003
  4. Chuck
    Feb 8, 2007
  5. Alfred Sehmueller
    Alfred Sehmueller
    Feb 20, 2004

Share This Page