tags:

views:

107

answers:

1

Hi I am looking for a way to authenticate my premium account from rapidshare and then once authenticated start a download. I have seen this done so many times in other languages but it seems its impossible to do in the one language i know (C#).

I have taken this entire project and converted it to C# so that i could debug it easier but it hasnt helped at all, most because the original project never used authentication and i have no idea how to do that. I should not that i am doing this in ASP.Net.

If someone can just help with the authentication i should be able to get the downloading correct.

Thanks

+1  A: 

I don't know how you're doing your downloading or what type of authentication they're using on their end, but you can use the NetworkCredential class with WebClient if it's Basic HTTP (like twitter, for example). Something like the following:

WebClient client = new WebClient();
client.Credentials = new NetworkCredential(user, pass);
string data = client.DownloadString(new Uri(some_url));
Rich
No you can not do that , they are using a forms based authentication , which means that you need to post your user name and password to a cgi page of theirs
RC1140
Rich
Then...send it to the request stream (WebRequest.GetRequestStream), and get the response stream with GetResponse and GetResponseStream. Seems a little verbose...might be able to do it with a simple WebClient method (UploadData()?)
Rich
Thanks thats a lot more on track , will try it out and let you know , the problem with the webclient is that it doesnt support cookies and is what is used to keep you authenticated (as far as i could see)
RC1140
Ok i have tried exactly as you specified and it did not work , i thought i might be using invalid urls but i tried mutiple and non of them worked
RC1140