[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

get page uses sock in Delphi

Posted on 2005-04-08
4
Medium Priority
?
165 Views
Last Modified: 2010-04-05
I want to open and get content of website use socket.
in PHP, I used fsockopen, but in PHP I don't know how do it ??
Please help me :|
0
Comment
Question by:ngocquynh85
  • 2
3 Comments
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 13738489
>>in PHP, I used fsockopen, but in PHP I don't know how do it ??

use fsockopoen

=o)
0
 
LVL 13

Accepted Solution

by:
BlackTigerX earned 2000 total points
ID: 13738543
just kidding... is simple using the Indy components, something like:


 HTTP := TIdHTTP.Create(FOwner);
with HTTP do
begin
  Request.UserAgent := 'Mozilla/4.0';
  Request.Connection := 'Keep-Alive';
  Request.ProxyConnection := 'Keep-Alive';
  Request.CacheControl := 'no-cache';
end;

Stream := TMemoryStream.Create;
try
  HTTP.Get(Url,Stream);
  Stream.SaveToFile('c:\SomeFile');
except
on e:exception do
begin
//error handling
end;
0
 
LVL 14

Expert Comment

by:cwwkie
ID: 16412294
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: BlackTigerX {http:#13738543}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

cwwkie
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question