Solved

Parse Image links

Posted on 2006-06-30
4
219 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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 2008 - Windows Protected Your PC 7 53
VS 2015 is giving [No relevant source lines] 2 40
Code enhancement 4 33
Need help with another query 10 39
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…
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 …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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