First of all, I have absolutely know knowledge of using C# for communicating with websites. I am under some time constraints so I am trying to crash through it but I getting more lost than anything.

What I have is a windows application that a user can build content files. I want to make it easier for users to share the content on my PHPBB3 forum. So when the user exports the content I want to have an option to automatically create a PHPBB3 forum topic with the content files name as the topic title and description as the post body (saved as strings during the export process). I also want it to add the file as an attachment. The user's forum loggin name and password are also saved in the application as strings.

  1. So in a step by step I want the application to do:
  2. Open up the web browser to the forum and loggin the user if they are not logged in.
  3. Create a new topic on a specific forum with a saved string used for the post title, and another for the post body.
  4. Attach the file to the post.
  5. I don't want the post to automatically submit as I would like the user to be able to edit the post as they want.

Can anyone help me?

I hate bumping threads like this, but I have been looking everywhere and can still not figure out how to accomplish this. I found a similar idea for PHPBB2, but conceptually it went over my head and the code as is doesn't work for PHPBB3. Plus, it doesn't seem to actually open the web page so much as it just sends the post, so the user won't get much of an opportunity to make it adjustments.

Please help me. I am at a complete loss here.

You can do and send anything you would over a browser as long as you're prepared to disect it and play around long enough, this includes the login process, redirection etc.

Its not something someone can just hand you an answer for.
However, if you monitor the HTML to/from your site and what would have been your browser everythings possible with time and patience.

However, Im not aware of anything "out of the can" that will interface with phpbb for you, you would need to do all the HTML ground work yourself.

Thanks for the reply. I can understand that pretty well. It seemed like something that wouldn't have a generic do x to get to y answer. However, would you mine pointing out a place to start? With all of the various types of information available in that general vein it has been very difficult for me to simply find a starting point that is more focused. For instance, how would I open the website in a browser, then manipulate that open site through the C# code?

I think that would be the best place to start looking. From there, I can build an understanding of the relationship and begin learning it myself...I hope.

you dont open it in a browser. You download the page to memory and work through with it. Look at HttpWebRequest and HttpWebResponse

Have you considered creating a web service for this? You could create one in PHP and simply automate these steps in the web service. All you'd have to do in C# is submit any files or any other data to the service and let it do the rest. I'm not sure how well it's going to play out with users being able to edit posts though. I'm sure you could integrate that in it.

I am using an existing PHPBB3 forum which allows file attachments. Maybe I don't understand the suggestion with creating a web service for it however. That is the main cusp of the problem, I am not familiar at all with C# and web development.

Well then its time to learn :)

If you want to write an app that works with your phpbb3, start off with as I suggested and get the pages, and examine what you get back

I hear ya. I just have to squeeze it in. It looks like I will have to add the feature in a patch as I really can't push release any further back.

This article has been dead for over six months. Start a new discussion instead.