I am working on a Winforms application and use C # as a development language. In one place, I need to send a request to a URL and get feedback.
I use my code inside a catch try block and I will catch a WebException. I noticed that WebException is due to two reasons.
(1) when the URL entered is incorrect (URL that does not exist)
(2) If there is no internet connection
So well, if I catch a WebException in a situation where the URL is correct, to check that there is no Internet connection on the local computer. (I need to check if an internet connection exists or not in order to continue the next step)
Can anyone confirm that my proposal is correct or, if not, why? Thanks inadvance
source share