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是没权限。