?
Solved

Parse Image links

Posted on 2006-06-30
4
Medium Priority
?
222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Accepted Solution

by:
kouroshparsa earned 1000 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 1000 total points
ID: 17023051
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

801 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