Solved

Retrive text from http.

Posted on 1998-09-24
6
137 Views
Last Modified: 2012-05-04
I need to retrive a single line of text from a file on my web server and load it into a string. I don't want to use the internet components that ship with delphi 4 since they require external files. Can someone give me an example of how this might be done.

Thanks.
0
Comment
Question by:Karma121397
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 200 total points
ID: 1340797
Check Francois Piette's great components at http://www.rtfm.be/fpiette/indexuk.htm. There is a freeware HTTP component with source and a demo. Your best bet is to download the whole ICS file, it seems that the .DPK files are missing if you download only the specific archive...
0
 

Author Comment

by:Karma121397
ID: 1340798
I've downloaded the complete set already... I have no clue how to convert the TMemoryStream, which the http component uses, into a string.  Could you give me an exapmle of how to accomplish this? Thanks.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340799
How about this,,,,

var
  f : TextFile;
 str : string;
begin
  AssignFile(f, 'C:\windows\yourfile.txt');
  Reset(f);
  Readln(f, str);
  ShowMessage(str);
  CloseFile(f);      
end;

Regards,
Viktor Ivanov
0
Industry Leaders: 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!

 

Author Comment

by:Karma121397
ID: 1340800
Is there no way to do it without having to save the stream to a file first?
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340801
This is not saving. This is reading the string from a text...In order to read the data you need to save it before that, wether you save it yourself you using programming code.

Regards,
Viktor Ivanov
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340802
Is that what you needed? ;->

Regards,
Viktor Ivanov
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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

696 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