I
I
itseksee2014-05-28 22:20:36
C++ / C#
itseksee, 2014-05-28 22:20:36

How to create a post on a WordPress site using C#?

Good day. It is required using C # to write a program that can create posts on a site that is powered by WordPress. You can, of course, through the parsing of html pages, but I would like to hear something more adequate.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Kozlov, 2014-05-28
@deniskozlov

Well, through the MySql database, push the texts of the posts directly there
Here is the description of the database codex.wordpress.org/Database_Description
1. Download the connector for .net from the MySql website: dev.mysql.com/downloads/connector/net/5.2.html
2. Connect it , add a namespace:
3. Create a connection and open it:

var connection = new MySqlConnection(@"Database=your_db;Data Source=your_host;User Id=your_user;Password=your_password");
connection .Open();

4. Create a command with an insert and execute it:
var command = new MySqlCommand(@"INSERT bla-bla-bla", 
     connection);
command.ExecuteNonQuery();

5. Don't forget to close the connection:
connection.Close();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question