我开发了新闻网站,并试图从另一个网站阅读rss,我使用这段代码来阅读
private void GetRSS()
{
try
{
WebRequest rssReq =ebRequest.Create("http://www.aljazeera.net/AljazeeraRss/845674de-
e247-4149-b2c4-432d70b0076b/acefc2c1-1a68-4977-91c3-969026916497");
//Create a Proxy
WebProxy px = new WebProxy("http://www.aljazeera.net/AljazeeraRss/845674de-e247-
4149-b2c4-432d70b0076b/acefc2c1-1a68-4977-91c3-969026916497", true);
// XPath="/rss/channel/item";
//Assign the proxy to the WebRequest
rssReq.Proxy = px;
//Set the timeout in Seconds for the WebRequest
rssReq.Timeout = 5000;
try
{
//Get the WebResponse
WebResponse rep = rssReq.GetResponse();
//Read the Response in a XMLTextReader
XmlTextReader xtr = new XmlTextReader(rep.GetResponseStream());
//Create a new DataSet
DataSet ds = new DataSet();
//Read the Response into the DataSet
ds.ReadXml(xtr);
//Bind the Results to the Repeater
Repeater1.DataSource = ds.Tables[3]; ;
Repeater1.DataBind();
}
catch(Exception EX)
{
throw EX;
}
//ProcessRSSItem("http://www.bbc.co.uk/arabic/index.xml");
}
catch (Exception EX)
{
throw EX;
}
}它在本地主机上运行得非常好,但当我将它上传到我的godaddy帐户上时,它没有读取任何内容,并且出现以下错误
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.有人能给我描述一下这个问题并给我一个解决方案吗?
问候
发布于 2012-09-23 01:20:04
您在GoDaddy上的用户、帐户或其他任何设备没有权限执行此操作。如果你应该有权限(并不是每个人都有),请联系GoDaddy。
https://stackoverflow.com/questions/12545938
复制相似问题