Hi,
Using WebClient due to strict content filtering some times I cannot open an HTTPS address, but I can open the same HTTP address will open.
So I want to try the HTTPS first, and if fails then try the HTTP, if it also fails then return the error.
What's the best algorithm?
I can try HTTPS and then try HTTP in CATCH or I can try each one in a separate TRY/CATCH and then evaluate their values or what?
Thanks.
Using WebClient due to strict content filtering some times I cannot open an HTTPS address, but I can open the same HTTP address will open.
So I want to try the HTTPS first, and if fails then try the HTTP, if it also fails then return the error.
Code:
Dim WebClient As New System.Net.WebClient
Dim NewString As String = WebClient.DownloadString("https://www.domain.com/file.txt")
WebClient.Dispose()
I can try HTTPS and then try HTTP in CATCH or I can try each one in a separate TRY/CATCH and then evaluate their values or what?
Thanks.