Just use the WebClient class. It's a few lines of code to retrieve a URL.
public string function GetUrl(Url)
{
string MergedText = "";
System.Net.WebClient Http = new System.Net.WebClient();
try
{
byte[] Result = Http.DownloadData(Url);
MergedText = Encoding.Default.GetString(Result);
}
catch(Exception ex)
{
ErrorMessage = ex.Message;
return null;
}
return MergedText;
}
If you need more control or need to figure out more about how to work with the full HTTP components in .NET check out:
http://www.west-wind.com/presentations/dotnetWebRequest/dotnetWebRequest.htmThere are a number of things that you can't do with WebClient in terms of configuration. I think setting timeouts was one so you may have to use the full thing.
FWIW, it sounds like what you're doing is exactly what
Web Monitor is doing, which is a multi-threaded URL checker that lets you look for specific content in your output and send warning messages etc. There's a full source version that lets you customize either the app itself or the monitoring API that can be plugged into other applications.
+++ Rick ---
>I have six URL addresses that I need to check from VB.NET if the response returned is ok. Most of the examples I have found on the NET are dealing with pinging an IP address. I need to pull the result from a URL and interpret it. The logic should include a timeout parameter that after a few seconds, I'll decide if it is a failure or not. I need VB.NET code without any third party software to accomplish that. What would be the best route to consider?