|
public HttpResult GetHtml(HttpItem item)
{
//返回参数
HttpResult result = new HttpResult();
try
{
//准备参数
SetRequest(item);
}
catch (Exception ex)
{
//配置参数时出错
return new HttpResult() { Cookie = string.Empty, Header = null, Html = ex.Message, StatusDescription = "配置参数时出错:" + ex.Message };
}
try
{
//请求数据
using (response = (HttpWebResponse)request.GetResponse())
{
GetData(item, result);
}
}
catch (WebException ex)
{
if (ex.Response != null)
{
using (response = (HttpWebResponse)ex.Response)
{
GetData(item, result);
}
}
else
{
result.Html = ex.Message;
}
}
catch (Exception ex)
{
result.Html = ex.Message;
}
if (item.IsToLower) result.Html = result.Html.ToLower();
return result;
}
红色的那一句报错
信息 是:“System.AccessViolationException”类型的未经处理的异常在 System.dll 中发生
其他信息: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。 |
|