/// <summary>
 /// 根据相传入的数据,得到相应页面数据
 /// </summary>
 /// <param name="item">参数类对象</param>
 /// <returns>返回HttpResult类型</returns>
 internal HttpResult GetHtml(HttpItem item)
 {
     if (item.Allowautoredirect && item.AutoRedirectCookie)
     {
         HttpResult result = null;
         for (int i = 0; i < 100; i++)
         {
             item.Allowautoredirect = false;
             result = httpbase.GetHtml(item);
             if (string.IsNullOrWhiteSpace(result.RedirectUrl))
             {
                 break;
             }
             else
             {
                 item.URL    = result.RedirectUrl;
                 item.Method = "GET";
                 if (item.ResultCookieType == ResultCookieType.String)
                 {
                     item.Cookie += result.Cookie;
                 }
                 else
                 {
                     item.CookieCollection.Add(result.CookieCollection);
                 }
             }
         }
         return(result);
     }
     return(httpbase.GetHtml(item));
 }
Example #2
0
 /// <summary>
 /// 根据相传入的数据,得到相应页面数据
 /// </summary>
 /// <param name="item">参数类对象</param>
 /// <returns>返回HttpResult类型</returns>
 internal HttpResult GetHtml(HttpItem item)
 {
     if (item.Allowautoredirect && item.AutoRedirectCookie)
     {
         HttpResult result = null;
         for (int i = 0; i < 100; i++)
         {
             item.Allowautoredirect = false;
             result = httpbase.GetHtml(item);
             if (string.IsNullOrWhiteSpace(result.RedirectUrl))
             {
                 break;
             }
             item.URL    = result.RedirectUrl;
             item.Method = "GET";
         }
         return(result);
     }
     return(httpbase.GetHtml(item));
 }