If pimagen(yy,0)<>"" Then
If File.Exists (File.DirDefaultExternal & "/bzmonitor/imgevento" , pimagen(yy,0)) Then
' if exist do nothing
Else
Dim j As HttpJob
j.Initialize(" ",Me)
'this line generate the error'
j.Download( "http://" & "http://myserver.com.mx" & "/" & "webdirectory" & "/" & pimagen(yy,0))
Wait For (j) JobDone (job As HttpJob)
If job.Success Then
ImageView2.SetBackgroundImage(job.GetBitmap)
Dim Out As OutputStream
Out = File.OpenOutput(File.DirDefaultExternal & "/bzmonitor/imgevento", pimagen(yy,0), False)
Dim tempbitmap As Bitmap
tempbitmap = ImageView2.Bitmap
tempbitmap.WriteToStream(Out, 100, "JPEG")
End If
Out.Close
Else
Log("Error" )
End If
End If
End If
Next