Search code examples
c#httpweb-applicationsvbulletin

Submitting new thread to vbulletin forum in C#


I want to send new thread in vbulletin forum through the application i made in C Sharp. As thread submission needs security token so i have to add that while submitting and also need to login to forum.

For vbulletin forum i want send post through my application. structure is like this. Structure of form

Ex: Url of forum : http://myforumurl.com/forum

Thread need to submit url : http://myforumurl.com/forum/newthread.php?do=newthread&f=01

So how can i submit the thread which have string data of Tag + Title + Message to submit url i.e http://myforumurl.com/forum/newthread.php?do=newthread&f=01

And i also need to send my Username and Password to that forum while submitting.


Solution

  • You need to send an HTTP POST request to the server. You can do this using the WebClient class. The request will need to contain all the fields a browser would typically submit, as well as the session cookies. You can get the session cookies by sending another POST request first, one that the browser would send when you log in.

    To see what the browser sends, you could use a Firefox addon like HttpFox, or just use the built-in features that both Chrome and Firefox have these days.

    I doubt anyone is going to just post the complete code for you though.