I need to perform some action in wordpress admin panel programmatically but can\'t manage how to login to Wordpress using C# and HttpWebRequest.
Here is what I do:>
TomerBu has the best answer for me, but something was missing.
in his code, remplace :
foreach (Cookie c in response.Cookies)
Console.WriteLine(c.Name + " = " + c.Value);
by
if (response.Cookies != null)
{
foreach (Cookie currentcook in response.Cookies)
request.CookieContainer.Add(currentcook); //This is the key !!!
}
Next for futur request, you'll have to reuse CookieContainer.