»ª·áÈí¼þ

»¥ÁªÍøÈí¼þ×ÊÔ´¹²Ïí

µ±Ç°Î»ÖãºÊ×Ò³ -> ×ÛºÏƵµÀ -> Õ¾³¤Ö®¼Ò

VB webbrowser ¿Ø¼þµÄÓ¦Ó㨿çÓò ÄÚǶÍøÒ³ÔªËصķÃÎÊ£©

'------------------------------------------------  

' »·¾³×¼±¸£º  

' 1.ΪÔËÐб¾³ÌÐò£¬Ó¦ÔÚ¡°²Ëµ¥->¹¤³Ì->²¿¼þ¡±ÖÐÌí¼Ó¡°Microsoft Internet Controls¡±  

' 2.²¢ÔÚ¡°²Ëµ¥->¹¤³Ì->ÒýÓá±ÖÐÌí¼Ó¡°Microsoft HTML Object Library¡±ºÍ¡°Edanmo's OLE interfaces & functions v1.4¡±  

' 3.ÇëÏȽ¨Á¢Îļþ"d:\1.html"£¬ÄÚÈÝΪ£º<iframe application="yes" width=700 height=600 src="http://www.baidu.com" mce_src="http://www.baidu.com"></iframe>  

' 4.Edanmo 's OLE interfaces & functions v1.4ÔÚÓÐЩ»úÆ÷¿ÉÄÜûÓУ¬¿ÉÒÔµ½ÕâÀïÏÂÔØ£ºhttp://download.csdn.net/source/2652292  

'  

' Author    : sysdzw  

' E-mail    : sysdzw@163.com  

' Bolg      : http://hi.baidu.com/sysdzw  

' QQ        : 171977759  

' Date      : 2010-4-6  

'------------------------------------------------  

Private Sub Form_Load()  

   wb1.Navigate2 "d:\1.html"  

End Sub  

Private Sub wb1_DocumentComplete(ByVal pDisp As Object, URL As Variant)  

 Debug.Print URL  

 If URL = "http://www.baidu.com/" Then  

   getFrames(wb1).Document.All("kw").Value = "¹È¸è"  

   MsgBox getFrames(wb1).Document.All("kw").Value  

 End If  

End Sub  

     

'WBΪҪ´¦ÀíµÄwebbrowser  

Private Function getFrames(ByVal WB As WebBrowser) As Object  

   Dim pContainer As olelib.IOleContainer  

   Dim pEnumerator As olelib.IEnumUnknown  

   Dim pUnk As olelib.IUnknown  

   Dim pBrowser As SHDocVwCtl.WebBrowser_V1  

   

   Set pContainer = WB.Object.Document  

   If pContainer.EnumObjects(OLECONTF_EMBEDDINGS, pEnumerator) = 0 Then  

      Set pContainer = Nothing  

      Do While pEnumerator.Next(1, pUnk) = 0  

         Set pBrowser = pUnk  

         If Err.Number = 0 Then  

            Print "Frame: " & pBrowser.LocationURL  

             

            If pBrowser.LocationURL = "http://www.baidu.com/" Then '¿ÉÒÔÔÚÕâÀï¼ÓÌõ¼þÅжϵõ½Ö¸¶¨µÄframe£¬»ù±¾¿ÉÒÔ¸ù¾Ýurl»òÕßinnerHTMLÖеÄij¸ö¹Ø¼ü×Ö·û  

               Set getFrames = pBrowser  

               Exit Function  

           End If  

         End If  

   

      Loop  

      Set pEnumerator = Nothing  

   End If  

End Function  



ÉÏһƪ£ºvb-¿çÓò·ÃÎÊÍøÒ³×î¼òµ¥·½·¨£¬»ñµÃ..
ÏÂһƪ£ºphp Êý×éÅÅÐòÒÔ¼°°´ÕÕij¸ö×Ö¶ÎÅÅÐò

ÆÀÂÛ

ÕÊ¡¡¡¡ºÅ: ÃÜÂë: (ÐÂÓû§×¢²á)
Ñé Ö¤ Âë:
±í¡¡Çé:
ÄÚ¡¡¡¡ÈÝ:

ËÑË÷
×îÐÂÎÄÕÂ
ͼƬÖ÷Ìâ
ÈÈÃÅÎÄÕÂ
ÍƼöÎÄÕÂ
Ïà¹ØÎÄÕÂ

    Ê× Ò³   |   °æȨÉùÃ÷   |   ¹ØÓÚÎÒÃÇ   |   ¹ã¸æ·þÎñ   |   ÁªÏµÎÒÃÇ   |   ÊÖ»ú°æ    |   ÍøÕ¾µØͼ
    Copyright@zhuchunyu.com all rights reserved
    Powered by zhuchunyu.com 2018-2025 zhuchunyu.com ÍîICP±¸05011767ºÅ-23