Click here to Skip to main content
12,242,175 members (47,932 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
please somebody help,,

is it possible to run multiple BHO in same time?
in this case,

i have to generate 2 BHO (2 add-ons) with different name,

but when i opened IE ,
the 1st BHO running well,but
the 2nd BHO is not running,

have somebody solution for this case?

Thank's
Posted 15-Jan-13 18:49pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

public class BHO:IObjectWithSite
{
    WebBrowser webBrowser;
    HTMLDocument document;
    public void OnDocumentComplete(object pDisp, ref object URL)
    {
        document = (HTMLDocument)webBrowser.Document;
        string href = document.location.href;
        //get top level page
        if (href == URL.ToString())
        {
            HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create("http://mysite.com");
            WebReq.Method = "POST";
            WebReq.ContentType = "application/x-www-form-urlencoded";
            byte[] buffer = Encoding.ASCII.GetBytes("string");
            WebReq.ContentLength = buffer.Length;
            Stream PostData = WebReq.GetRequestStream();
            PostData.Write(buffer, 0, buffer.Length);
            PostData.Close();
            // Prepare web request and send the data.
            HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
            StreamReader streamResponse = new StreamReader(WebResp.GetResponseStream(), true);
            string Response = streamResponse.ReadToEnd();
            Newtonsoft.Json.Linq.JObject json = Newtonsoft.Json.Linq.JObject.Parse(Response);
            string active = json["active"].ToString();
            //print to screen
            System.Windows.Forms.MessageBox.Show(active, "Title");
        }
    }


http://stackoverflow.com/questions/8588808/next-steps-debugging-crash-in-customer-environment[^]
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 15 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100