当前位置: 代码迷 >> ASP.NET >> The remote server returned an error: (403) Forbidden解决思路
  详细解决方案

The remote server returned an error: (403) Forbidden解决思路

热度:4015   发布时间:2013-02-25 00:00:00.0
The remote server returned an error: (403) Forbidden
public virtual string HttpGet(string url)
  {
  HttpWebRequest webRequest = null;
   
  string responseData = "";

  webRequest = System.Net.WebRequest.Create(url) as HttpWebRequest;
  webRequest.Method = "GET";
  webRequest.ServicePoint.Expect100Continue = false;
   
  StreamReader responseReader = null;
   
  try
  {
  responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream());
  responseData = responseReader.ReadToEnd();
  }
  catch
  {
  throw;
  }
  finally
  {
  webRequest.GetResponse().GetResponseStream().Close();
  responseReader.Close();
  responseReader = null;
  }
  return responseData;
  }
执行这个方法会报The remote server returned an error: (403) Forbiddenc错误

------解决方案--------------------------------------------------------
http://blog.csdn.net/ansencumt/article/details/6024828
看这个 有用吗
------解决方案--------------------------------------------------------
要先 login 。。。
------解决方案--------------------------------------------------------
403是没权限。
  相关解决方案