how to retrieve CGI rss feed using asp.net but error The remote server returned an error: (503) Serv

R

rote

I'm trying to recieve some feeds from a cgi page like below but i keep
getting error

"The remote server returned an error: (503) Server Unavailable."

Any ideas?
The page(rss.cgi) needs a username and password to get couls that be the
reason if yes
how can i pass the username and password in my code



private void Page_Load(object sender, System.EventArgs e)

{

myXml.Document = getXML(http://myserver/cgi-bin/rss.cgi);

}



public XmlDocument getXML(string sourceFile)

{

XmlDocument tempgetXML = null;

System.Net.WebRequest myRequest = System.Net.WebRequest.Create(sourceFile);

System.Net.WebResponse myResponse = myRequest.GetResponse();

System.Xml.XmlTextReader myReader = new
System.Xml.XmlTextReader(myResponse.GetResponseStream());

System.Xml.XmlDocument doc = new System.Xml.XmlDocument();

doc.Load(myReader);

tempgetXML = doc;

myResponse.Close();

myReader.Close();

return tempgetXML;

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top