mardi 22 septembre 2015

Access site with login from C#

I want to save the text from this site as string: http://ift.tt/1KMuRIH

The link goes to a personal portfolio that I set up with my registered account on this site. I can perfectly access this site manually in chrome:

enter image description here

However, I can't get it into C# automatically as it only redirects to the non-logged in page:

enter image description here

This code can only save the non-logged in page as string:

 WebClient client = new WebClient();
 File.WriteAllText(@"D:\site.txt", Encoding.UTF8.GetString(client.DownloadData("http://ift.tt/1KMuRIH")));

How can I save the logged in site in C# as string?




Aucun commentaire:

Enregistrer un commentaire