1

我开发了新闻站点,并试图从另一个站点读取 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.

任何人都可以为我描述这个问题并给我一个解决方案

问候

4

1 回答 1

0

您的用户、帐户或 GoDaddy 上的任何内容均无权执行此操作。如果您应该拥有权限(并非所有人都拥有),请联系 GoDaddy。

于 2012-09-22T17:20:03.987 回答