Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...