usvpn Posted December 25, 2013 Posted December 25, 2013 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. Dim WebClient As New System.Net.WebClient Dim NewString As String = WebClient.DownloadString("https://www.domain.com/file.txt") WebClient.Dispose() 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.