Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2003, 10:51 PM
Registered User
 
Join Date: Dec 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help w/Internet Control in VB.NET

Does anyone have sample code in VB.NET that demonstrates how to get to the innertext from a webpage like the Internet control did in VB6? I can't seem to get this to work:

' After creating a reference to the Microsoft Internet Controls library 1.1

Imports SHDocVw
WithEvents MyBrowser As New SHDocVw.InternetExplorerClass()

' Inside some click event

MyBrowser.Navigate("www.someurl.com/home.html")

' After document completely loads.

Private Sub MyBrowser_DocumentComplete(ByVal pDisp As Object, ByRef URL As Object) Handles MyBrowser.DocumentComplete
        Dim strFileName = Directory.GetCurrentDirectory & "\temp\download.txt"
        Dim fs As New FileStream(strFileName, FileMode.OpenOrCreate)
        Dim sw As New StreamWriter(fs)

        MsgBox("Got HTML")
        sw.WriteLine("Document Complete")
        sw.Close()
        MyBrowser.Quit()
        MyBrowser = Nothing
End Sub

The object interface does not support the OpenURL method and innertext properties that the VB6 control supported. While debugging, I can see the iinertext property that contains the text I want, but no way to get to it!






Similar Threads
Thread Thread Starter Forum Replies Last Post
P2P/Winsock/Internet Programming VB.NET tutorial amtronx VB.NET 2 July 1st, 2009 12:04 AM
add icon in InterNet Explorer in C# or Vb.net nashnash ASP.NET 1.0 and 1.1 Professional 3 October 4th, 2004 12:56 AM
Help w/Internet Control in VB.NET jagged30net Pro VB.NET 2002/2003 1 May 29th, 2004 02:33 AM
Internet Transfer Control HELP!!!!! kastronyc VB How-To 1 September 22nd, 2003 02:48 AM
Internet Transfer Control jake VB How-To 5 July 28th, 2003 04:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.