TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sathyam P
NA
3
809
The remote server returned an error: (403)
Feb 1 2016 3:43 PM
any help on this? I am getting 403, 400, etc
try
{
ArrayList urlList = new ArrayList();
urlList.Add("http://engagepoint.com/");
urlList.Add("http://forensicfluids.com/");
urlList.Add("http://www.BizTechSolInc.com");
urlList.Add("http://cvisiontech.com/");
urlList.Add("http://www.msprojectexperts.com/");
foreach (string url in urlList)
{
try
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.AllowAutoRedirect = true;
webRequest.Timeout = 30000;//30 secs
webRequest.Method = "GET";
webRequest.ContentType = "text/html";
webRequest.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
string companyPresentUrl = response.ResponseUri.AbsoluteUri;
companyPresentUrl = companyPresentUrl.ToLower();
int httpStatusCode = (int)response.StatusCode;
string httpStatusDescription = response.StatusDescription;
System.Console.ForegroundColor = ConsoleColor.Green;
System.Console.WriteLine(url + "-" + httpStatusCode + "-" + httpStatusDescription);
}
catch (Exception exception)
{
System.Console.ForegroundColor = ConsoleColor.Red;
System.Console.WriteLine("Error: " + exception.Message);
}
}
}
catch (Exception exception)
{
System.Console.ForegroundColor = ConsoleColor.Red;
System.Console.WriteLine("Error: " + exception.Message);
}
Reply
Answers (
2
)
how to export Datable into .xls only and download code .
i make a project of movie ticket booking in asp.net c#.