Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6043153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:52:06+00:00 2026-05-23T06:52:06+00:00

I have a WebClient object and am using the DownloadFileAsync method to get a

  • 0

I have a WebClient object and am using the DownloadFileAsync method to get a file, although before I can I’m needing to log into the site, which seems to be a difficult. I’m wanting to log into https://ssl.rapidshare.com/ (which appears to be using Forms authentication). I’ve found the following WebClient code that is cookie aware:

public class CookieAwareWebClient:WebClient {
    private CookieContainer m_container=new CookieContainer();
    protected override WebRequest GetWebRequest(Uri address) {
        WebRequest request=base.GetWebRequest(address);
        if(request is HttpWebRequest) {
            (request as HttpWebRequest).CookieContainer=m_container;
        }
        return request;
    }
}

However, I’m afraid my code doesn’t appear to be co-operating:

gWebClient=new CookieAwareWebClient();
if(gGroupEntry.GetStringProperty(CGroupEntry.EStringProperties.DownloadURL).Contains("rapidshare.com"))
    gWebClient.Credentials=new System.Net.NetworkCredential(CSaverLoader.gUsername, CSaverLoader.gPassword, "https://ssl.rapidshare.com/");
gWebClient.DownloadFileCompleted+=new AsyncCompletedEventHandler(gWebClient_DownloadFileCompleted);
gWebClient.DownloadProgressChanged+=new DownloadProgressChangedEventHandler(gWebClient_DownloadProgressChanged);
gWebClient.DownloadFileAsync(new Uri(gGroupEntry.GetStringProperty(CGroupEntry.EStringProperties.DownloadURL)), gDownloadDirectory+"/"+gGroupEntry.GetStringProperty(CGroupEntry.EStringProperties.FileName));

Why could this be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:52:06+00:00Added an answer on May 23, 2026 at 6:52 am

    Are you able to use the HttpWebRequest Class in the System.Net namespace? This is a much more flexible class than the light-weight WebClient for making HTTP requests and includes stuff like HttpWebRequest.CookieContainer Property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing data from an xml file using WebClient. In DownloadStringCompleted method I have
I have a download manager of sorts that uses WebClient.DownloadFileAsync. Webclient doesn't seem to
I have a problem downloading particular file types by WebClient. So there are no
I have in my Form constructor, after the InitializeComponent the following code: using (WebClient
I have a class that implements the IDisposable interface. I am using a webclient
Have just started using Google Chrome , and noticed in parts of our site,
Alright, I have ran into a problem when using DownloadDataAsync and having it return
I have this code, but can't get it all working. I am trying to
I have a simple JSON object graph I'm trying to render using a Mustache
I have this class called SiteAsyncDownload.cs Here's the code: public class SiteAsyncDownloader { WebClient

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.