473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

"proper" way to download several hundred text files from a web-site ?

As an exercise I wrote a small C# program to download several hundred text files of guitar tab music by parsing the home page of the
site and retrieving all the links to the music text files and using 'WebRequest and a StreamReader to download them.

I followed up the call to WebRequest.Create with a call to Application.DoEvents, and called Application.DoEvents() again after the
call to ReadToEnd on the StreamReader.

What I was looking for was some kind of delay mechanism to ensure that I was not making requests to the site too frequently. Is
there any way to ask a site something like : "Can I have another helping please, or would you rather I come back later ?."

Appreciate any clues.

thanks, Bill
Nov 15 '05 #1
1 1775
"Bill Woodruff" <bi***@dotscience.com> wrote in
news:#x**************@TK2MSFTNGP11.phx.gbl:
What I was looking for was some kind of delay mechanism to ensure that
I was not making requests to the site too frequently. Is there any way
to ask a site something like : "Can I have another helping please, or
would you rather I come back later ?."

Appreciate any clues.

thanks, Bill


The RFC says no more than 4 connections to any given HTTP 1.0 server at any
given moment, and no more than 2 to any given HTTP 1.1 server at any
moment. As long as you don't break that rule (and I think that the
WebRequest class respects IE's settings, so if you haven't changed them
with some sort of "accellerator", those are defaults) you should be fine.

If you want to introduce more delay, then Thread.Sleep() is always good, as
long as you don't do it in UI threads (but you wouldn't do work in UI
threads, would you? that would be bad).

Mark
Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: Haines Brown | last post by:
I'm having trouble finding the character entity for the French abbreviation for "number" (capital N followed by a small supercript o, period). My references are not listing it. Where would I...
1
by: Rick Brown | last post by:
I'm trying to scan a barcode that contains the text string "BPWOT08762" into a textbox for use in a DLookup or query grid. I want to look thru a table's field that contains the last 6 characters...
1
by: seanick | last post by:
I am trying to locate an installed application, and I so far have been unable to do so programattically. There does not appear to be a way to do so directly from the .NET framework, either 1.1 or...
4
by: Richard | last post by:
Hi I'm new to ASP/Web programming so any help would be appreciated... Situation: On my web page I would like to present a link {or button} that would allow the user to download a large file. ...
1
by: Rune Jacobsen | last post by:
Hi, I've been trying to figure this one out, but my experience just doesn't have what it takes... :| I am writing an application that reads an XML file and displays the contents in various...
8
by: eminemence | last post by:
Hi, I have been trying to get STLPort work for Symbian. I am using CodeWarrior compiler and it spews this errors namely *************************************************************************...
43
by: Christoph Schneegans | last post by:
Hi! Okay, so positions on "text/html" XHTML are totally contradicting. Anyway! I hope there's more consensus about "application/xml" XHTML. I've recently learned that Opera 9.0b2 does not only...
7
by: Erik Funkenbusch | last post by:
I've been thinking about different ways to address this problem, and I figured i'd just toss this out and see if anyone has a good solution. I've got database field of type char(1), this field...
1
by: MJR | last post by:
Could anyone please help me change data in uppercase to data in propercase in MS Access?
0
by: Russell Warren | last post by:
I'm running python 2.5.1 and it seems that SimpleXmlRpcServer is not setup to support the base datetime module in the same way xmlrpclib has been with "use_datetime". I see that someone (Virgil...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.