سلام . با این کد میشه چک کرد که URL وجود داره یا نه . اما برای دامنه های IR جواب نمی ده . همچنین سایت های فیلتر شده رو به اشتباه ( عدم وجود ) برمی گردونه . یعنی فکر می کنه که
این URL وجود نداره .
public static bool isValidURL(string url)
{
WebRequest webRequest = WebRequest.Create(url);
WebResponse webResponse;
try
{
webResponse = webRequest.GetResponse();
}
catch //If exception thrown then couldn't get response from address
{
return false;
}
return true;
}