Click here to Skip to main content
Rate this: bad
good
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 17: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
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 442
1 sanket saxena 355
2 Abhinav S 268
3 OriginalGriff 250
4 CPallini 205
0 Sergey Alexandrovich Kryukov 8,497
1 OriginalGriff 4,850
2 Peter Leow 3,839
3 Maciej Los 3,535
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 15 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid