C# Check url exist?
c#
Solution
First, you need to understand that your question is at least twofold, you must first check if the server is responsive, using ping for example - that's the first check, while doing this, consider timeout, for which timeout you will consider a page as not existing?
second, try retrieving the page using many methods which are available on google, again, you need to consider the timeout, if the server taking long to replay, the page might still "be there" but the server is just under tons of pressure.
Problem
How can I check whether a page exists at a given URL? I have this code: ``` private void check(string path) { try { Uri uri = new Uri(path); WebRequest request = WebRequest.Create(uri); request.Timeout = 3000; WebResponse response; response = request.GetResponse(); } catch(Exception loi) { MessageBox.Show(loi.Message); } } ``` But that gives an error message about the proxy. :(