I answered a question similar to this earlier. Some of it may be helpful. You can find it at
Downloading files without direct address through C# program[
^].
This can be very difficult and the way I worked it was to use HttpFox within Firefox to monitor the actual HTTP requests that Firefox followed when doing this. The things that you need to watch for are the Referrer and the Cookies.
Wordpress is a bit different than in the other article, so here's what I did and using it, I was able to get the HTML of the https://en.wordpress.com site (filling in log and pwd with actual login credentials).
HttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest.Create(@"https://en.wordpress.com/wp-login.php");
myRequest.Referer = @"https://en.wordpress.com";
myRequest.Method = "POST";
myRequest.Host = "en.wordpress.com";
string postData=@"log=username&pwd=password&testcookie=1&redirect_to=https://wordpress.com&rememberme=forever&submit";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] data = encoding.GetBytes(postData);
myRequest.ContentLength = data.Length;
myRequest.CookieContainer = new CookieContainer();
myRequest.ContentType ="application/x-www-form-urlencoded";
myRequest.AllowAutoRedirect = true;
Stream newStream = myRequest.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();
string pageSource = "";
using (HttpWebResponse response = (HttpWebResponse)myRequest.GetResponse())
{
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
pageSource = reader.ReadToEnd();
}
}