How to login to wordpress programmatically?

前端 未结 8 1406
时光取名叫无心
时光取名叫无心 2020-12-24 04:14

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:

相关标签:
8条回答
  • 2020-12-24 04:50

    Thanks to everyone. I managed how to make it work only when using sockets. Wordpress sends several Set-Cookie headers but HttpWebRequest handles only one instance of such header so some cookies are lost. When using sockets I can get all needed cookies and login to admin panel.

    0 讨论(0)
  • 2020-12-24 04:50

    I see no obvious problem with your code, sorry. But Wordpress has an XML-RPC interface, which has to be enabled in the admin interface. I wrote some python scripts for this interface and it worked like a charm.

    0 讨论(0)
提交回复
热议问题