[2005] Verifying remote folder exists
I use this function to check whether a remote file or website exists...
VB Code:
Public Function CheckURLExists(ByVal site As String) As Boolean
Dim Success As Boolean
Dim objUrl As New System.Uri(site)
Dim objWebReq As System.Net.WebRequest
Dim objResp As System.Net.WebResponse
objWebReq = System.Net.WebRequest.Create(objUrl)
Try
objResp = objWebReq.GetResponse
objResp.Close()
Success = True
Catch ex As Exception
Success = False
End Try
objWebReq = Nothing
Return Success
End Function
But this does will not work when checking whether a remote folder exists (it produces a 'forbidden' error with no exception thrown). Does anyone have a function/sub for this?
p.s. I have been searching MSDN for info but cant find anything.
Re: [2005] Verifying remote folder exists
Re: [2005] Verifying remote folder exists
This isnt the same issue.
This thread concerns a method to verify the presence of a remote folder (I showed the code I currently use to test for the presence of sites and files).
Re: [2005] Verifying remote folder exists
My apologies. I should read more carefully.
Re: [2005] Verifying remote folder exists
For services rendered to 18,678 hapless programmers like me, you are forgiven. ;)