Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Delphi] Load webfile.txt in my Memo1.component?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
h4c0r-BG
Master Cheater
Reputation: 0

Joined: 29 Nov 2006
Posts: 449
Location: The yogurt country

PostPosted: Sun May 18, 2008 10:02 am    Post subject: [Delphi] Load webfile.txt in my Memo1.component? Reply with quote

How can i properly load a text file from my website so it's loaded in my Memo?

For example i have:

http://mysite.lol/mytxt.txt

and i want to load it in my Memo whenever i click a button.

I've tryed:

Code:
Memo1.lines.loadfromfile('http://mysite.lol/mytxt.txt'); --> not working


Code:
Opendiaglog1.Filename('http://mysite.lol/mytxt.txt');
Opendialog1.Execute;
Memo1.lines.loadfromfile(opendialog1.filename);

----> not working ...


But if I only execute my opendialog and it allows me to browse my PC and I put the URL in it ... it loads... Rolling Eyes

Can someone sujest me a proper way to load it? Thank you.

_________________

Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sun May 18, 2008 10:23 am    Post subject: Reply with quote

DownloadFile then use that file

So create like tmp.text in the folder

and save the file to that using DownloadFile

_________________
Back to top
View user's profile Send private message
h4c0r-BG
Master Cheater
Reputation: 0

Joined: 29 Nov 2006
Posts: 449
Location: The yogurt country

PostPosted: Sun May 18, 2008 10:30 am    Post subject: Reply with quote

blankrider wrote:
DownloadFile then use that file

So create like tmp.text in the folder

and save the file to that using DownloadFile



I want to avoid in any way saving that file to the harddrive.
Even i don't want to place it in a temp folder & load it from there.

_________________

Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Sun May 18, 2008 10:32 am    Post subject: Reply with quote

Try this:
Code:
  with TDownloadURL.Create(self) do
  begin
    URL:='http://holyblah.googlepages.com/CTMaking.txt';
    filename:='C:\a.temp';
    ExecuteTarget(nil);
    memo1.Lines.LoadFromFile(filename);
    DeleteFile(filename);
  end;
Back to top
View user's profile Send private message
h4c0r-BG
Master Cheater
Reputation: 0

Joined: 29 Nov 2006
Posts: 449
Location: The yogurt country

PostPosted: Sun May 18, 2008 10:36 am    Post subject: Reply with quote

HolyBlah wrote:
Try this:
Code:
  with TDownloadURL.Create(self) do
  begin
    URL:='http://holyblah.googlepages.com/CTMaking.txt';
    filename:='C:\a.temp';
    ExecuteTarget(nil);
    memo1.Lines.LoadFromFile(filename);
    DeleteFile(filename);
  end;


http://www.vbforums.com/showthread.php?t=345726

Here we can see a bigger example of that how to download file from internet.

Well i want to modify that code and avoid saving the file to my harddrive.

_________________

Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sun May 18, 2008 11:12 am    Post subject: Reply with quote

Just use URLDownloadToFile() (add URLmon to the uses list), save it somewhere and open it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites