Solved

Parse Image links

Posted on 2006-06-30
4
216 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
Comment Utility
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
Comment Utility
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now