如: webBrowser1.Document.Write("<A href="f_detail.aspx?f_id=225" target=_blank>心电图</A>");在webBrowser控件点击“心电图”,取出 f_detail.aspx?f_id=225 值如何来写,在webBrowser的什么事件中写,向高手求助,我是新手!

解决方案 »

  1.   

     webBrowser1.DocumentText = " <A href=\"f_detail.aspx?f_id=225\" target=_blank>心电图 </A>";            while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
                    System.Windows.Forms.Application.DoEvents();            HtmlElementCollection _List = webBrowser1.Document.GetElementsByTagName("A");            for (int i = 0; i != _List.Count; i++)
                {
                    MessageBox.Show(_List[i].GetAttribute("href"));
                }
      

  2.   

    string href=webBrowser1.Document.ActiveElement.GetAttribute("href");