Downloading random file text file
Downloading random file text file
Downloading random file text file
Downloading random file text file
Downloading random file text file
Downloading random file text file Downloading random file text file Downloading random file text file Downloading random file text file Downloading random file text file Downloading random file text file Downloading random file text file Downloading random file text file
Downloading random file text file Downloading random file text file
Downloading random file text file
Go Back  Xtreme Visual Basic Talk > > > Downloading random file text file


Reply
 
Thread Tools Display Modes
  #1  
Old 04-23-2009, 05:32 PM
rEnEeK rEnEeK is offline
Newcomer
 
Join Date: Apr 2009
Posts: 9
Default Downloading random file text file


Hello, I am newbie and I need help. I'm working a program, which will download files from my server. But I need, program will download random files from text file on server, for example:

I have www.myweb.com/links.txt

In links.txt are these links:

If I run a program, it will download first link, after finish download it will download fifth link, second link etc...

Downloading of one link works fine for me, but I need download more links...

Cutting from code:

Quote:
theRequest = WebRequest.Create("http://temp.rondoclub.eu/1.mp3")
So I need: theRequest = WebRequest.Create("RANDOM LINK")

Can anybody help me? Very thanks
Reply With Quote
  #2  
Old 04-24-2009, 07:32 AM
Qua's Avatar
QuaDownloading random file text file Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

There are two steps:
- Downloading the file in the first place;
- Selecting a random file from the file

Since you're coding in VB.NET you can use
Code:
My.Computer.Network.DownloadFile("url", "localfile")
to download the file. At that point you can read the urls contained in it line for line using the System.IO namespace.

To pick a random file every time you could put them randomly into a queue or stack, or you could put them into a list and draw them out at random.
__________________
Reading is the foundation for all knowledge - Unknown.
Reply With Quote
  #3  
Old 05-21-2009, 01:54 AM
rEnEeK rEnEeK is offline
Newcomer
 
Join Date: Apr 2009
Posts: 9
Default

Thanks
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Downloading random file text file
Downloading random file text file
Downloading random file text file Downloading random file text file
Downloading random file text file
Downloading random file text file
Downloading random file text file Downloading random file text file Downloading random file text file Downloading random file text file Downloading random file text file Downloading random file text file Downloading random file text file
Downloading random file text file
Downloading random file text file
 
Downloading random file text file
Downloading random file text file
 
-->