Delphi XE:idHttp& Request.Range,一个bug? [英] Delphi XE: idHttp & Request.Range, a bug?

查看:541
本文介绍了Delphi XE:idHttp& Request.Range,一个bug?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Delphi XE。我尝试设置 Request.Range idHttp ,但我不能这样做。德尔福不允许我在设计时和运行时都不做。



例如。我在设计时设置了'6000 - '。一个属性一直都是空的。



在线程中):

  Downloader.Request.Range:=(IntToStr(DFileStream.Position)+' - '); 
同步(procedure begin showmessage(Downloader.Request.Range)end);

showmessage(Downloader.Request.Range)我没有显示(空字符串)。



我在HTTPAnalyzer中检查过请求 - >我的程序不发送范围。



在Delphi 2010中检查此行为 - 全部正常。我在设计/实时设置了一个范围。这两种情况都是可以的。



有人有想法吗?



这是一个bug还是什么



谢谢!

解决方案

范围属性已被弃用,而您必须使用范围属性。



检查此样本

 使用
IdHTTPHeaderInfo;

var
范围:TIdEntityRange;
begin
范围:= FHttp.Request.Ranges.Add;
Range.StartPos:= FRangeFrom;
Range.EndPos:= FRangeTo;
FHttp.Get(FURL,FileStream);
结束


I have Delphi XE. I try to set Request.Range of idHttp but I cannot do this. Delphi doesn't allow me to do this neither at design time nor at run time.

E.g. I set '6000-' in a design time -> a property gets empty all time.

I do (in a thread):

Downloader.Request.Range:=(IntToStr(DFileStream.Position) + '-');
synchronize(procedure begin showmessage(Downloader.Request.Range) end); 

showmessage(Downloader.Request.Range) shows me nothing (an empty string).

I checked a request in HTTPAnalyzer -> my program doesn't send a range.

A checked this behavior in Delphi 2010 - all is normal. I set a range in a design/real time. A result is fine in the both cases.

Does anybody have ideas?

Is this a bug or what?

Thanks!

解决方案

The Range property is deprecated instead you must use the the Ranges property.

Check this sample

uses
  IdHTTPHeaderInfo; 

var
  Range: TIdEntityRange;
begin
    Range := FHttp.Request.Ranges.Add;
    Range.StartPos := FRangeFrom;
    Range.EndPos := FRangeTo;
    FHttp.Get(FURL, FileStream);
end;

这篇关于Delphi XE:idHttp& Request.Range,一个bug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆