Click here to Skip to main content
16,009,429 members
Home / Discussions / C#
   

C#

 
GeneralFormatting text in RichTextBox Pin
leppie16-Jul-02 21:45
leppie16-Jul-02 21:45 
GeneralRe: Formatting text in RichTextBox Pin
leppie18-Jul-02 3:47
leppie18-Jul-02 3:47 
Generalstring vs. String; (string) casting vs. ToString() Pin
yaaang16-Jul-02 21:20
yaaang16-Jul-02 21:20 
GeneralRe: string vs. String; (string) casting vs. ToString() Pin
leppie16-Jul-02 22:01
leppie16-Jul-02 22:01 
GeneralRe: string vs. String; (string) casting vs. ToString() Pin
jparsons17-Jul-02 3:51
jparsons17-Jul-02 3:51 
GeneralRe: string vs. String; (string) casting vs. ToString() Pin
Mazdak17-Jul-02 9:17
Mazdak17-Jul-02 9:17 
GeneralFile Verifying Pin
Nnamdi Onyeyiri16-Jul-02 21:16
Nnamdi Onyeyiri16-Jul-02 21:16 
GeneralRe: File Verifying Pin
leppie16-Jul-02 22:32
leppie16-Jul-02 22:32 
Nnamdi Onyeyiri wrote:
i want to be able to generate a checksum, or something, for the remote file,

Thats not really possible unless you own the internet Smile | :)
I assume you want somethin similar to eDonkey's file hashing to prevent corrupted downloads. Unless you can control the other side, you cant get a checksum.

I also presume you want somethin similar to GetRight's Segmented downloading. Most programs doing this, creates a blank file to the size (from the returned HTTP header) of the downloaded file, then writes to the file byte by byte.

You can easily run a "scan" thru the file to see what is still needed. Also by changing the header sent u can resume most files if the server supports partial content (see below).

Nnamdi Onyeyiri wrote:
i am trying to add support for multiple downlioad locations

In your your Download class change the "URL" property to URL[]. Or if you dont have somethin like that, you might want to create it to keep track of other variables like speed, pingtime and availability. Also note that you will need to make sure each download location has exactly the "same" file by comparing the sizes. Also , you need to make sure that the remote file's date hasnt changed (incase file size is the same) when resuming the download, although some servers might create the file on the fly to prevent leeching Frown | :(

Hope this all helps Smile | :)

Example of header sent for partial content:

!!!! ----Header Sent----
>>>> GET /Downloads/MagicInstall.msi HTTP/1.1
Host: www.dotnetmagic.com
Range: bytes=23232-
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)
Accept: */*
If-Range: Fri, 12 Jul 2002 18:28:00 GMT

Example of header recieved for partial content:

!!!! ----Header Recv----
HTTP/1.1 206 Partial Content
Date: Wed, 17 Jul 2002 08:19:38 GMT
Server: Apache
Last-Modified: Fri, 12 Jul 2002 18:28:00 GMT
ETag: "1441e9-8b600-3d2f1fb0"
Accept-Ranges: bytes
Content-Length: 547648
Content-Range: bytes 23232-570879/570880
Content-Type: text/plain


READ MSDN
GeneralRe: File Verifying Pin
Nnamdi Onyeyiri17-Jul-02 0:10
Nnamdi Onyeyiri17-Jul-02 0:10 
GeneralRe: File Verifying Pin
leppie17-Jul-02 0:45
leppie17-Jul-02 0:45 
GeneralRe: File Verifying Pin
Nnamdi Onyeyiri17-Jul-02 0:53
Nnamdi Onyeyiri17-Jul-02 0:53 
GeneralRe: File Verifying Pin
leppie17-Jul-02 1:06
leppie17-Jul-02 1:06 
GeneralRe: File Verifying Pin
Nnamdi Onyeyiri17-Jul-02 2:01
Nnamdi Onyeyiri17-Jul-02 2:01 
GeneralRe: File Verifying Pin
leppie17-Jul-02 2:32
leppie17-Jul-02 2:32 
GeneralRe: File Verifying Pin
Nnamdi Onyeyiri17-Jul-02 2:34
Nnamdi Onyeyiri17-Jul-02 2:34 
GeneralRe: File Verifying Pin
leppie17-Jul-02 3:19
leppie17-Jul-02 3:19 
GeneralRe: File Verifying Pin
Nnamdi Onyeyiri17-Jul-02 4:02
Nnamdi Onyeyiri17-Jul-02 4:02 
GeneralRe: File Verifying Pin
leppie17-Jul-02 10:20
leppie17-Jul-02 10:20 
GeneralRe: File Verifying Pin
Nnamdi Onyeyiri17-Jul-02 0:11
Nnamdi Onyeyiri17-Jul-02 0:11 
GeneralWindows Service won't start.... Pin
Jason.NET16-Jul-02 11:20
Jason.NET16-Jul-02 11:20 
QuestionPainting a component *after* the form is displayed? Pin
Zombies with Coffee, LLC16-Jul-02 11:21
professionalZombies with Coffee, LLC16-Jul-02 11:21 
AnswerRe: Painting a component *after* the form is displayed? Pin
Nathan Blomquist17-Jul-02 8:27
Nathan Blomquist17-Jul-02 8:27 
GeneralWindows API Call to change resolution Pin
Brian Olej16-Jul-02 10:35
Brian Olej16-Jul-02 10:35 
GeneralRe: Windows API Call to change resolution Pin
Eric Gunnerson (msft)17-Jul-02 13:40
Eric Gunnerson (msft)17-Jul-02 13:40 
GeneralRe: Windows API Call to change resolution Pin
Brian Olej17-Jul-02 14:44
Brian Olej17-Jul-02 14:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.