|
-
Jan 1st, 2006, 10:04 AM
#1
Thread Starter
Lively Member
[RESOLVED] Web Access - Retrieving Source Code
Hi,
How do you retrieve source code for a webpage? In VB6, I could use the Internet Transfer Control and simply type:
Text1.Text = Inet1.OpenURL("http://www.google.co.uk/")
What's the equivalent in VB2005?
-
Jan 1st, 2006, 11:28 AM
#2
Fanatic Member
Re: Web Access - Retrieving Source Code
Very easy using the WebClient Class
VB Code:
Dim client As New WebClient()
TextBox1.Text = client.DownloadString("http://www.vbforums.com")
client.Dispose()
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Jan 1st, 2006, 12:12 PM
#3
Thread Starter
Lively Member
Re: Web Access - Retrieving Source Code
Hi,
I didn't have a reference to the Net namespace, originally, so the first line had to be:
Dim client As New Net.WebClient()
Thanks.
-
Jan 1st, 2006, 12:15 PM
#4
Fanatic Member
Re: [RESOLVED] Web Access - Retrieving Source Code
Imports System.Net at the top. forgot to mention...
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|