Taewon Lee, links to a good code base that does what you want

From: jOs (rocksolidrobot_at_yahoo.com)
Date: 07/14/04

  • Next message: TechieGator: "Web Browser and Word Application Instances"
    Date: Thu, 15 Jul 2004 03:48:27 +1000
    
    

    JOB: Adjust security for C# App hosting WebBrowser

    I have taken the code from Chapter 8 of Ted Faison's book
    "Component-based Development with Visual C#" and now have a
    .NET Windows Forms Application WebBrowser Written in C#.

    Here is a description of the app so far...
    1. The C# App returns properties, methods, and strings to the
       html pages via window.external.somemethod("etc")
    2. 100% of the useable Form area displays the WebBrowser contol
    3. Graphical User Interface will be done using html pages+script

    Here are 3 tasks that need to be done...
    1. Lower the Security setting to the Level of a HyperText Application (HTA)
       so that that we don't get any more "An ActiveX control on this page might
       be unsafe to interact with other parts of the page. Do you want to allow
       this interaction?" pop-ups.

    2. Surpress Script Errors and log the Time, FileName, LineNumber, and Error
       Message to an xml file.

    3. Helper functions/references to marshall the Custom method return values
       into JScript types. Make it so C# can send all the different kinds of
       JScript objects :: Arrays, Automation, XML docs, Dates, Objects (strings,
       boolens, and numbers already work ok) via the window.external.whatever()

    Links for this project:
    email me for a zip conatining the C# App.

    The code base for this project was obtained from:
    http://www.faisoncomputing.com/samples/programming_samples.htm
    http://www.faisoncomputing.com/samples/CSharp/MyCustomWebBrowser_3.zip

    The topic for this project is "WebBrowser Customization".
    I have not yet found a working C# implementation of
    URL Security Zones, IInternetHostSecurityManager,
    GetOverrideKeyPath, or what ever it is, that allows
    ActiveX alerts, and script Error Dialogs to be turned off.

    Newsgroup searches suggest that several people have found a
    way to do it, but they have gone incommunicado.

    If there is a better (more inclusive, or concise) code base than Ted's
    (for a C# mshtml WebBrowser) that meets the requirements in point (1)
    then I would be happy to switch over and move on with the many other
    (more interesting) things that need to be added to the App.

    Thanks for considering this work request, I am willing to pay for work
    done and would like to hear from people who can do it.

    rocksolidrobot@yahoo.com
    Joshua Donnelly,
    Brisbane Australia


  • Next message: TechieGator: "Web Browser and Word Application Instances"

    Relevant Pages

    • Re: AxShDocVw and DragOver
      ... In my app, if I drag plain text over the webbrowser ... control that is wrapped by my user control, ...
      (microsoft.public.dotnet.framework.windowsforms.controls)
    • WebBrowser Scroll Position
      ... I'm using a WebBrowser in my app, and the content needs to be updated ... I do not want to lose the scroll position after each update since this is ... Thomas ...
      (microsoft.public.dotnet.framework.windowsforms.controls)
    • drag image URL from webbrowser
      ... I want to drag images from my webbrowser to a TImage in my app and in the ... process capture the image's URL (not necessarily the same as the page's ...
      (comp.lang.pascal.delphi.misc)
    • WebBrowser problem..
      ... I'm building an app that automaticly fills in info in a webform I have, ... The WebBrowser starts at a given URL. ... code fills out the login form, ... When the popup opens, ...
      (microsoft.public.vb.general.discussion)
    • RE: C# Browser with HTA permissions ~ JOB request ~ Earn praise & cash
      ... It is on topic for this newsgroup. ... > Here is a description of the App so far... ... Suppress Script Errors and log the Time, FileName, LineNumber, and Error ... > code base than Ted's that meets the requirements then I would be happy to ...
      (microsoft.public.dotnet.languages.csharp)