Hi, I am trying to check if an image file exists. If it does exist then use it, otherwise, use a default image. I am trying to pass integrated windows login credentials to get a response but I always return false. It seems to not like the credentials. Does anyone have input here? Thanks in advance!
Here is my code:
PS - All this code is done inside the Custom Code of SSRS
Here is my code:
PS - All this code is done inside the Custom Code of SSRS
Code:
Function IsValid(ByVal Url As String) As Boolean
Dim URLRes As Net.FileWebResponse
Dim URLReq As Net.FileWebRequest
Dim myURI As New Uri("file://www.example.com/" & Url & ".jpg")
Try
URLReq = Net.FileWebRequest.Create(myURI)
URLReq.Credentials = Net.CredentialCache.DefaultCredentials
URLRes = URLReq.GetResponse()
Return True
Catch ex As Exception
Return False
End Try
End Function