|
-
May 29th, 2003, 07:00 PM
#1
Thread Starter
Lively Member
Ive looked everywhere: How do i download HTML for a web page?
I know you could do thin is VB 6, but i cannot find anything on any webpages for VB.net
-
May 29th, 2003, 07:03 PM
#2
PowerPoster
-
May 29th, 2003, 07:06 PM
#3
Thread Starter
Lively Member
thats C#
-
May 29th, 2003, 07:30 PM
#4
PowerPoster
But more importantly, it is .Net. Look at it, you can figure out what classes they use to get the source.
-
May 29th, 2003, 07:38 PM
#5
PowerPoster
OK, I did a quick translation... I don't guarentee the work though, it was from my head.
VB Code:
Public Function DownloadURL(url As String) As String
Dim returnString As String
Dim req As WebRequest = new WebRequest.Create(url)
Dim res As WebResponse = req.GetResponse()
Dim totalBuffer As Integer = 0
Dim buffer() As Byte = new Byte(128)
Dim stream As Stream = res.GetResponseStream()
totalBuffer = stream.Read(buffer,0,128)
Dim strRes As StringBuilder = new StringBuilder("")
Do While totalBuffer <> 0
strRes.Append(Encoding.ASCII.GetString(buffer,0, totalBuffer))
totalBuffer = stream.Read(buffer, 0, 128)
Loop
returnString = strRes.ToString()
Return returnString
End Function
-
May 29th, 2003, 07:47 PM
#6
Thread Starter
Lively Member
ah much thanks, i gotta play with it a little
-
May 30th, 2003, 06:19 AM
#7
Sleep mode
Originally posted by Azkar
thats C#
In .NET , you shouldn't have any problems switching between .NET Languages since they use the same Framework and CLR . Below my sig. a tool that help you converting From/To VB.NET Code To/From C# Code.
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
|