C chrong Unregistered / Unconfirmed GUEST, unregistred user! 2001-08-26 #1 保存当前WebBrowser浏览的位置的图片, 比如:http://localhost:8080/images/logo.gif 用什么方法可以做到? 最好有例程,多谢了的说
飞 飞来石 Unregistered / Unconfirmed GUEST, unregistred user! 2001-09-05 #4 您的主页中有如下的HTML语句:,那么在您的Web Server的缺省的TwebActiveItem中如下处理: var Jpg: TJpegImage; S: TMemoryStream; I: Integer; Begin Randomize; I:= Random(3); Jpg := TJpegImage.Create; try Jpg.LoadFromFile('http://localhost:8080/images/logo.gif'); S := TMemoryStream.Create; try Jpg.SaveToStream(S); S.Position := 0; Response.ContentType := 'image/jpeg'; Response.ContentStream := S; Response.SendResponse; finally S.Free; end; finally Jpg.Free; end; end; 因为使用了TJpegImage类,所以必须在Uses中添加对JPEG文件的包含
您的主页中有如下的HTML语句:,那么在您的Web Server的缺省的TwebActiveItem中如下处理: var Jpg: TJpegImage; S: TMemoryStream; I: Integer; Begin Randomize; I:= Random(3); Jpg := TJpegImage.Create; try Jpg.LoadFromFile('http://localhost:8080/images/logo.gif'); S := TMemoryStream.Create; try Jpg.SaveToStream(S); S.Position := 0; Response.ContentType := 'image/jpeg'; Response.ContentStream := S; Response.SendResponse; finally S.Free; end; finally Jpg.Free; end; end; 因为使用了TJpegImage类,所以必须在Uses中添加对JPEG文件的包含
M millzhou Unregistered / Unconfirmed GUEST, unregistred user! 2001-09-05 #5 楼上的理解错了吧,不是做服务器端,而是客户端的下载问题 用ftp组件,具体看Demo中的FastNet例程
W whaoye Unregistered / Unconfirmed GUEST, unregistred user! 2001-09-06 #7 我告诉你一个很简单的方法: 你自己写一个shll,监听一个端口,我假设为99好了, 然后你打开ie,输入http://localhost:99/ 你看到了什么??? 你的,明白?
A Ale. Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-10 #9 最后回答时间是 2001-9-6 12:57:00 ,解决了吗?没有解决请回答。我收这 200 分。
I iapollo Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-10 #10 //用了indy控件, IdHTTP1: TIdHTTP; ... procedure TForm1.Button1Click(Sender: TObject); var tmpStream:TFileStream; begin tmpStream:=TFileStream.Create('c:/get.gif',fmCreate); try idhttp1.Get(http://localhost:8080/images/logo.gif',tmpStream); finally tmpStream.Free; end; end;
//用了indy控件, IdHTTP1: TIdHTTP; ... procedure TForm1.Button1Click(Sender: TObject); var tmpStream:TFileStream; begin tmpStream:=TFileStream.Create('c:/get.gif',fmCreate); try idhttp1.Get(http://localhost:8080/images/logo.gif',tmpStream); finally tmpStream.Free; end; end;