首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >系统安全SecurityException

系统安全SecurityException
EN

Stack Overflow用户
提问于 2012-09-23 01:09:43
回答 1查看 167关注 0票数 1

我开发了新闻网站,并试图从另一个网站阅读rss,我使用这段代码来阅读

代码语言:javascript
运行
复制
      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帐户上时,它没有读取任何内容,并且出现以下错误

代码语言:javascript
运行
复制
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.

有人能给我描述一下这个问题并给我一个解决方案吗?

问候

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-23 01:20:04

您在GoDaddy上的用户、帐户或其他任何设备没有权限执行此操作。如果你应该有权限(并不是每个人都有),请联系GoDaddy。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12545938

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档