精华内容
下载资源
问答
  • vb WebBrowser屏蔽右键

    2010-10-17 13:38:08
    vb WebBrowser屏蔽右键 vb WebBrowser屏蔽右键
  • .net和 vb WebBrowser 浏览器兼容问题自己封装的开发中遇到的第一次加载注册表可能未注册 F5一下就会成功
  • VB WebBrowser解析

    2013-02-28 19:34:45
    vb+Webbrowser控件详解,可以自动化使用浏览器进行网络操作
  • vb webbrowser不弹出新窗口,且在原窗口打开新链接代码1: Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)Dim frm As Form1Set frm = New Form1frm.Visible = TrueSet ppDisp = frm....

    vb webbrowser不弹出新窗口,且在原窗口打开新链接
    代码1:

    Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
    Dim frm As Form1
    Set frm = New Form1
    frm.Visible = True
    Set ppDisp = frm.WebBrowser1.object
    End Sub
     

    代码2:

    Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
    Cancel = True
    WebBrowser1.Navigate2 WebBrowser1.Document.activeElement.href
    End Sub

    代码3:

    Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
    On Error Resume Next
    Dim frmWB As Form1
    Set frmWB = New Form1
    frmWB.WebBrowser1.RegisterAsBrowser = True
    Set ppDisp = frmWB.WebBrowser1.object
    frmWB.Visible = True
    frmWB.Top = Form1.Top
    frmWB.Left = Form1.Left
    frmWB.Width = Form1.Width
    frmWB.Height = Form1.Height
    End Sub

    代码4:

    Dim WithEvents Web_V1 As SHDocVwCtl.WebBrowser_V1

    Private Sub Form_Load()
        Set Web_V1 = WebBrowser1.Object
    End Sub
       
    Private Sub Web_V1_NewWindow(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Processed As Boolean)
        Processed = True
        WebBrowser1.Navigate URL

    转载于:https://www.cnblogs.com/luyichuan/archive/2012/05/02/2479289.html

    展开全文
  • VB webbrowser 浏览器

    2008-11-28 16:17:16
    屏蔽自动弹出窗口,只有鼠标点击的网页才能下载。
  • vb WebBrowser文件夹视图

    2010-08-17 02:03:32
    通过改变WebBrowser1.Document.CurrentViewMode属性来实现 值 查看方式 1 图标 3 列表 4 详细资料 5 缩略图 6 平铺 7 幻灯片(不允许以幻灯片方式查看时自动改为缩略图)
  • VB WebBrowser控件

    2015-04-07 11:10:44
    使用WebBrowser控件打开百度个人设置页面之后 (http://www.baidu.com/p/setting/profile/basic 需要先登录百度帐号) 如何修改个人简介里面的信息 这个好像是用JS动态添加的,所以用WebBrowser1.Document找不到...
  • vb WebBrowser控件

    2012-02-27 16:58:08
    公司要做一个网站发布器的...所有决定用vb做了。代码很简单 Option Explicit Private Declare Sub Sleep Lib "kernel32 " (ByVal dwMilliseconds As Long) Private Sub Form_Load() WebBrowser1.Navi...

    公司要做一个网站发布器的,功能很简单,就是到固定的地址去取出最新的网站地址,然后自动打开网页。所有决定用vb做了。

    代码很简单

    Option Explicit
    Private Declare Sub Sleep Lib "kernel32 " (ByVal dwMilliseconds As Long)
    Private Sub Form_Load()
        WebBrowser1.Navigate2 ("http://localhost/url.htm")
        
        While WebBrowser1.Busy Or WebBrowser1.ReadyState <> 4
            DoEvents
        Wend
        
        Dim strHtml As String
        
        Dim doc
        Set doc = WebBrowser1.Document
        
        
        WebBrowser1.Navigate2 ("http://localhost/url.htm")
            
        strHtml = WebBrowser1.Document.body.innerText
             
        'Debug.Print strHtml
            
        Dim Browser As Object
        Set Browser = CreateObject("InternetExplorer.Application")
        Browser.Visible = True
        Browser.Navigate (strHtml)
    
        End
    
    End Sub

     

    遇到的问题
    1、WebBrowser获取网页内容时经常获取不到,但是断点调试却是可以的,估计是网络反应慢引起的,所以加入了 WebBrowser1.Busy Or WebBrowser1.ReadyState <> 4

      的判断。
    2、vb中用sleep(100)时必须在头部加上

    Option Explicit
    Private Declare Sub Sleep Lib "kernel32 " (ByVal dwMilliseconds As Long)

     
    这样也可以消除在调用默认浏览器是被360误认为是木马

     

    展开全文
  • rivate Sub Command1_Click()Dim YDMYDM = WebBrowser1.Document.body.createtextrange().htmltextOpen "D:\WEB.html" For Output As #1Print #1, YDMClose #1End Sub ================= 工程里引用:Microsoft ...

    rivate Sub Command1_Click()
    Dim YDM
    YDM = WebBrowser1.Document.body.createtextrange().htmltext
    Open "D:\WEB.html" For Output As #1
    Print #1, YDM
    Close #1
    End Sub

    =================

    工程里引用:Microsoft HTML object Library

    工程里部件:Microsoft Internet controls

                         Microsoft rich textbox controls 6.0 (SP6)

     

    在窗体中放置一个WEBbrowser控件,放置一个richtextbox控件

    代码:


    Private Sub Form_Load()
    WebBrowser1.Navigate "http://www.sohu.com"
    End Sub

    Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    Text1.Text = WebBrowser1.Document.documentElement.outerHTML
    End Sub

     

     

    如需修改网页内容,增加以下代码:

    Private Sub Command1_Click()
    Dim wdoc As HTMLDocument
    Set wdoc = WebBrowser1.Document
    wdoc.body.innerHTML = "<font size=10>dfkdjfkdfjdkfjdkfjdk</font>"    ‘网页内容
    'WebBrowser1.Document.body.innerHTML = "<font size=10>dfkdjfkdfjdkfjdkfjdk</font>"       与上句二选一
    End Sub
     

     

    转载于:https://www.cnblogs.com/luyichuan/archive/2012/03/06/2382283.html

    展开全文
  • VB WebBrowser1设置内核版本

    千次阅读 2018-09-13 16:13:25
    加入注册表 Set x = CreateObject("wscript.shell") ...使用WebBrowser Control控件的应用程序所使用的默认值,在IE7标准模式中按照网页上!DOCTYPE指令来展示网页。 注:11000(0×2af8) IE11

    加入注册表

    Set x = CreateObject("wscript.shell")
    b=x.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\" & App.EXEName)
    If b = "" Then
    Set x = Nothing
    Dim w
    Set w = CreateObject("wscript.shell")
    w.regwrite"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\" & App.EXEName, "2711", "REG_DWORD"
    Set w = Nothing
    Else
    Set x = Nothing
    End If

     

     

    On Error GoTo Err1
    Dim LinkName As String
    LinkName = CreateObject("Wscript.Shell").RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION")
    If LinkName <> "" Then
    Set x = Nothing
    Dim w
    Set w = CreateObject("wscript.shell")
    w.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\" & App.EXEName + ".exe", "2711", "REG_DWORD"
    Set w = Nothing
    Else
    Set x = Nothing
    End If
    Exit Sub
    Err1:
    Exit Sub

    FEATURE_BROWSER_EMULATION设置说明
    说明
    10001 (0x2711) Internet Explorer 10。网页以IE 10的标准模式展现,页面!DOCTYPE无效
    10000 (0x02710) Internet Explorer 10。在IE 10标准模式中按照网页上!DOCTYPE指令来显示网页。Internet Explorer 10 默认值。
    9999 (0x270F) Windows Internet Explorer 9. 强制IE9显示,忽略!DOCTYPE指令
    9000 (0x2328) Internet Explorer 9. Internet Explorer 9默认值,在IE9标准模式中按照网页上!DOCTYPE指令来显示网页。
    8888 (0x22B8) Internet Explorer 8,强制IE8标准模式显示,忽略!DOCTYPE指令
    8000 (0x1F40) Internet Explorer 8默认设置,在IE8标准模式中按照网页上!DOCTYPE指令展示网页
    7000 (0x1B58) 使用WebBrowser Control控件的应用程序所使用的默认值,在IE7标准模式中按照网页上!DOCTYPE指令来展示网页。

    注:11000(0×2af8)    IE11

    展开全文
  • 有时需要对网页进行操作,但webbrowser控件却为完成装载,即可用此函数检测
  • vb webbrowser中的html与vb交互

    千次阅读 2014-07-11 20:39:12
    Private Sub Form_Load()  Open App.Path & IIf(Right(App.Path, 1) = "\", "", "\") & "E.htm" For Binary As #1  Put #1, , "Name:"  Close #1  WebBrowser1.Navigate App.Path & IIf(Right(A
  • 111116 VB WebBrowser 加入

    2011-11-16 19:35:56
    右击工具箱,在出现的快捷菜单中选择“部件...”,确保在弹出的对话框中选中“控件”标签,找到Microsoft Internet Controls,在它前面的...发现工具箱中多了图标,其中,地球图标代表的控件正是我们需要的WebBrowser
  • VB Webbrowser控件如何屏蔽右键

    千次阅读 2015-12-29 23:29:09
    '加入webbrowser控件 '在窗体上自定义一个菜单(设为MyMenu) '复制下面代码,运行即可禁止右键菜单了 '====窗体代码==== Dim WithEvents M_Dom As MSHTML.HTMLDocument Private Function M_Dom_oncontextmenu()...
  • VB WebBrowser控件总结

    千次阅读 2011-03-06 09:49:00
    1.webbrowser控件的DocumentComplete和DownloadComplete的区别文档完全下载后,一个 DownloadComplete 事件就被引发。这并不一定表明可以通过对象模型安全地访问文档内容了。DocumentComplete 事件才表明所有的...
  • VB Webbrowser 网页编码

    2012-05-29 19:01:46
    就是用webbrowser.document.write写了个页面,但是显示的编码有问题啊,而且在网页里还改不了编码 [img=http://fmn.rrimg.com/fmn065/20120529/1900/original_pX91_270e000003b8118e.jpg][/img]
  • <TD id=j_id0:results:j_id40:j_id41:0:j_id42 class="dataCell "><SPAN id=j_id0:results:j_id40:j_id41:0:j_id72>WCAYUJS55680</SPAN></TD> ...TD id=j_id0:results:j_id40:j_id41:0:j_id43...
  • vb webbrowser 保存网页源码的各种…

    千次阅读 2016-02-24 11:22:10
    我在网上找到使用rft控件保存...txtHTML.Text = WebBrowser1.document.body.innerText ´flag :rsftext 保存为txt文件,strtmp文件路径 txtHTML.saveFile strtmp, rtfText 将其name属性设置为web   Private Sub Com
  • VB Webbrowser控件详解

    万次阅读 2008-02-15 13:14:00
    新加内容:提交表单form1: Private Sub Command1_Click() WebBrowser1.Document.Forms("form1").submit End Sub 将form1中的名为u的属性设为不可用: Private Sub Command2_Click() WebBrowser1.Document.Forms(...
  • WebBrowser1.Document.parentWindow.execScript "[color=#FF0000]addPointPoint[/color](" & Text1 & "," & Text2 & "," & Text3 & ")" 上面这条VB语句,Text3参数为什么不能是 字母呢,是...
  • 引用:http://zhidao.baidu.com/question/133403436.html WebBrowser1.Navigate "http://www.baidu.com" Do DoEvents If WebBrowser1.ReadyState = 4 Then MsgBox "载入完成": Exit Do Loop
  • WebBrowser1.Document.frames("topFrame").Document.frames("mainFrame").Document.Parentwindow.execScript "DS(document.getElementById('nextObject'))", "javascript" 但把元素名换成下面的变量后,就运行了...
  • [size=14px]学习用VB6.0 编程来操作网页, 有的链接在网页代码中只显示javascript()之类的,只有鼠标点后才能打开相应页面。 所以试想有没有办法找到 webbrowser 中链接文字的坐标 比如“转到链接” 然后用...
  • WebBrowser1.Move 50, WebBrowser1.Top, Me.ScaleWidth - 100, Me.ScaleHeight - WebBrowser1.Top End Sub Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) If URL <> ...
  • 如题...................
  • VB webbrowser处理多个iframe

    千次阅读 2009-04-08 15:23:00
    1.用两个循环 for x = 0 to wb1.document.all.length-1 if wb1.document.all(x).tagname="IFRAME"then for y=0 to wb1.document.all(x).document.all.length-1
  • <a hidefocus="true" id="switcher_plogin" class="switcher_plogin" ... If WebBrowser1.Document.All(i).id = "switcher_plogin" Then WebBrowser1.Document.All(i).Click End If Next 请大家帮忙看看
  • 自动登录财付通,难点在于会出现验证码,并且验证码页是在iframe元素下的,出于各种安全考虑,webbrowser控件不提供这种访问机制!当然,第一想到的是将这个网页拿出来,可是输入完毕验证码后,点击“确定”需要与原...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 700
精华内容 280
关键字:

vbwebbrowser