views:

40

answers:

1

Hi,

I am trying to download a file from rapidshare using System.Net.WebClient in C#. I wanted to implement authorization using the http header field "Authorization: Basic ".

I do it with the following code: WebClient.Headers.Add(HttpRequestHeader.Authorization, "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(_userPass)));

Problem is that, when i access rapidshare I get a redirected to a sub domoin of rapidshare, this means The problem is that this field, Authorization, (unlike "Cookie") isn't added to the hedear in the second (redirected) request.

This blocks me from authenticating with the server. How can I make the class pass the authorization header with the redirected request, or is there a better way to pass on authorization?

Is better, "righter" way to do this, maybe with a diffrent library?

All help will be very apprichated.

Thanks.

A: 

I think that rapidshare uses cookies to authenticate users and allow direct downloads...

EDIT: I did some digging on google and found a "Simple Rapidshare Download Class". Maybe this would be helpful to you?

silvo