Witam.
Jakim najprostszym sposobem można sprawdzić czy obrazki są aktywne ? (około 100 linków w różnych TextBoxach)
Jest na to może jakiś gotowy skrypt ? Czy musze WebBrowserem latać po wszystkich linkach ?
Chciałem wykorzystać coś takiego, ale to się sprawdzi tylko w przypadku jeśli jest błąd jakiś np 404..
Public Function CheckURL(ByVal HostAddress As String) As Boolean
CheckURL = False
Dim url As New System.Uri(HostAddress)
Dim wRequest As System.Net.WebRequest
wRequest = System.Net.WebRequest.Create(url)
Dim wResponse As System.Net.WebResponse
Try
wResponse = wRequest.GetResponse()
'Is the responding address the same as HostAddress to avoid false positive from an automatic redirect.
If wResponse.ResponseUri.AbsoluteUri().ToString = HostAddress Then 'include query strings
CheckURL = True
End If
wResponse.Close()
wRequest = Nothing
Catch ex As Exception
wRequest = Nothing
MsgBox(ex.ToString)
End Try
Return CheckURL
End Function
a np w takim przypadku już nie...
http://i51.tinypic.com/2ent3ye.jpg