Solved

Parse Image links

Posted on 2006-06-30
4
217 Views
Last Modified: 2010-04-23
Hi

I need to parse a collection of image links from a HTML string, download and place them in a temp file to be used as ButtonBase.Image Property .

The image links that need to be parsed are along the lines "http://anywebsite.com/sample" & (a integer 1-100) & ".png"

Can anybody please help?
0
Comment
Question by:IAJWDDIY
4 Comments
 
LVL 2

Accepted Solution

by:
kouroshparsa earned 250 total points
ID: 17021776
webAddress is a string containing the URL
fileName and filePath are strings

Try
            Dim client As New WebClient
            client.DownloadFile(webAddress, filePath & "\" & fileName)
            client.Dispose()
Catch
            MsgBox(Err.Description)
End Try
'--------------
Note: You can either read HTML files or download, save them and read them. (depending on what you want)
Downloading is described above.
To Read, try some thing like:
            Dim stream As IO.Stream = client.OpenRead("webAddress")
            Dim bf(1024) As Byte
            Dim str As String = stream.Read(bf, 0, 1000)
or better yet, look at MSDN:

http://msdn2.microsoft.com/en-us/library/system.net.security.sslstream.beginread.aspx

 Then search for all "http\\"s ...store all web addresses of images in an array.
0
 
LVL 8

Assisted Solution

by:kaliyugkaarjun
kaliyugkaarjun earned 250 total points
ID: 17023051
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.net/WinForms: adjust Screen Resolution 6 58
VB.Net - KeyPress Event 4 36
Disable extension 8 38
SQL LINE CONTINUATION ISSUE 12 33
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question