WebClient DownloadFile over ssl / https

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gavkel

    WebClient DownloadFile over ssl / https

    Can anyone get this to work? All Im getting is the login html being
    downloaded.

    Would appreciate any help - my heads hurts

    Thanks
    Gav

  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: WebClient DownloadFile over ssl / https

    gavkel,

    What do you mean the login html? If you are getting a response at all,
    then it indicates that you are not having any problems with the SSL
    connection or HTTPS.

    Can you provide some sample code?


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "gavkel" <gavkel@hotmail .comwrote in message
    news:1154537915 .411713.67320@s 13g2000cwa.goog legroups.com...
    Can anyone get this to work? All Im getting is the login html being
    downloaded.
    >
    Would appreciate any help - my heads hurts
    >
    Thanks
    Gav
    >

    Comment

    • gavkel

      #3
      Re: WebClient DownloadFile over ssl / https

      Ok

      Uri uri = new
      Uri("https://www.scoobydoo.c om/downloads/velma_statistic s.csv");
      WebClient webClient = new WebClient();

      CredentialCache mycache = new CredentialCache ();
      mycache.Add(new Uri("https://www.scoobydoo.c om/home.html"),
      "Basic", new NetworkCredenti al("scoobydooby doo", "Passw0rd") );
      webClient.Crede ntials = mycache;

      webClient.Downl oadFile(uri, @"c:\gav.txt ");

      Now, whats happening is Im trying to download velma_statistic s.csv (cos
      I love her!!) but its over HTTPS. I can see whats happening - when I
      copy and paste the contents of the downloaded gav.txt into a html page
      in VS, I get the login page that I would need to firstly complete in IE
      before successfully downloading my csv file, again manually.

      So, any ideas? By the way, I like Daphne too but me and Velma have
      always had a thing going on...

      Thanks

      Comment

      • gavkel

        #4
        Re: WebClient DownloadFile over ssl / https

        Ok

        Uri uri = new
        Uri("https://www.scoobydoo.c om/downloads/velma_statistic s.csv");
        WebClient webClient = new WebClient();

        CredentialCache mycache = new CredentialCache ();
        mycache.Add(new Uri("https://www.scoobydoo.c om/home.html"),
        "Basic", new NetworkCredenti al("scoobydooby doo", "Passw0rd") );
        webClient.Crede ntials = mycache;

        webClient.Downl oadFile(uri, @"c:\gav.txt ");

        Now, whats happening is Im trying to download velma_statistic s.csv (cos
        I love her!!) but its over HTTPS. I can see whats happening - when I
        copy and paste the contents of the downloaded gav.txt into a html page
        in VS, I get the login page that I would need to firstly complete in IE
        before successfully downloading my csv file, again manually.

        So, any ideas? By the way, I like Daphne too but me and Velma have
        always had a thing going on...

        Thanks

        Comment

        • Joerg Jooss

          #5
          Re: WebClient DownloadFile over ssl / https

          Thus wrote gavkel,
          Ok
          >
          Uri uri = new
          Uri("https://www.scoobydoo.c om/downloads/velma_statistic s.csv");
          WebClient webClient = new WebClient();
          CredentialCache mycache = new CredentialCache ();
          mycache.Add(new
          Uri("https://www.scoobydoo.c om/home.html"),
          "Basic", new NetworkCredenti al("scoobydooby doo", "Passw0rd") );
          webClient.Crede ntials = mycache;
          webClient.Downl oadFile(uri, @"c:\gav.txt ");
          >
          Now, whats happening is Im trying to download velma_statistic s.csv
          (cos I love her!!) but its over HTTPS. I can see whats happening -
          when I copy and paste the contents of the downloaded gav.txt into a
          html page in VS, I get the login page that I would need to firstly
          complete in IE before successfully downloading my csv file, again
          manually.
          >
          So, any ideas? By the way, I like Daphne too but me and Velma have
          always had a thing going on...
          You'll need to use HttpWebRequest and HttpWebResponse to programmtically
          log in to the web site and fetch the file. That's a FAQ, so your favorite
          search engine should provide you a lot of references to check out.

          Cheers,
          --
          Joerg Jooss
          news-reply@joergjoos s.de


          Comment

          Working...