首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

HttpWebResponse 的 ContentLength 为 -1,该怎么处理

2012-05-27 
HttpWebResponse 的 ContentLength 为 -1VB.NET codeDim requestScrape As HttpWebRequest...Dim resp As

HttpWebResponse 的 ContentLength 为 -1

VB.NET code
Dim requestScrape As HttpWebRequest'...Dim resp As HttpWebResponse = requestScrape.GetResponse()dim L = resp.ContentLength


我获取 http://www.163.com 这类的页面时,上面代码的这个resp.ContentLength值为-1
我想取得下载进度,这个resp.ContentLength=-1就不能进行设置进度,这个该怎么办

[解决办法]
Transfer-Encoding:chunked
不发送Content-Length响应头

热点排行