I have a loop that loops through this sub. However, I recieve an
WebException error in my try statement. "An exception occurred during a
WebClient request." This message doesnt happen when I am only looping
throught the sub once, however when I process multiple records, I recieve
this error for every record after the first one.
And the images that is downloaded does show up for all records processed. So
everything works there is just an error, that says to the contrary.
TIA,
Steve Wofford
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebC lient
' Sets the default image directory
Dim checksSignature Uri As String = "http://68.106.74.63/rateQuest/images/"
' Sets the imagename used for both download and local file access
Dim checksSignature FileName As String = "checksSignatur e.jpg"
' Sets download resource
Dim checksSignature Resource As String = checksSignature Uri +
checksSignature FileName
' Sets the local resource for local app to access the downloaded file
Dim checksSignature LocalFile As String = "C:\" + checksSignature FileName
Try
' Downloads the file
myWebClient.Dow nloadFile(check sSignatureResou rce, checksSignature LocalFile)
Catch ex As System.Net.WebE xception
MsgBox("Unexpec ted Error occurred with Check Signature Image from URL: " &
ex.Message.ToSt ring())
' INSERT AN EXIT APPICATIION METHOD TO CLOST THE APP.
End Try
' Imports checksSignature .jpg 150px X 60px
Dim checksSignature As New Bitmap(checksSi gnatureLocalFil e)
xPos = leftMargin + 450
yPos = topMargin + 120
ev.Graphics.Dra wImage(checksSi gnature, xPos, yPos)