tags:

views:

264

answers:

5

I'm a beginner in programming. I've just made a program called "Guessing Game". And it seems to work fine. Can I integrate it into a website? The CMS that I'm using is Mambo.

=== additional info's

Thanks for all your suggestions.

I still don't have any background about Silverlight, WPF and Java Script which I think sounds good. I'm using Windows and I programmed my "Guessing Game" from Microsoft Visual Studio 2008 and it's using Window application forms.

Yes I guess, for the moment I let it be and start to learn Silverlight or Java Script so that I can integrate it on my website:-) Thanks for all your input guys:-)

Cheers

+2  A: 

There are several questions that you still need to answer.

  1. What is your server running? If its not Windows, your exe will not run at all unless it is compatible with Mono or a similar framework for your server's operating system.
  2. How does your "Guessing game" interact with the user? If it is through a WinForms GUI, it will you will not be able to use that GUI on the web. If your game is a WPF application your easiest route may be to port it to Silverlight and serve it up on a web page.

It is typically not trivial to make a regular windows application run in a web environment since on on the web you are really running in the browser, not on Windows.

heavyd
+1  A: 

Yes - in general, when you're talking about software, anything is possible. The question is, how difficult will it be?

To understand that, you have to give us more details about "Guessing Game" including how it is designed, what it's interfaces are, how readily extensible it is, and how prepared you are to change or extend it.

For example, if it is a Windows Forms GUI app, then it will be diifficult to integrate into a web app. If it is a console app, then it will be a little easier. If you can modify it to run as a Windows Service, then a little easier. If you can modify it to accept input from the network (as opposed to getting input solely from the keyboard + mouse), still easier.

Cheeso
+4  A: 

A standalone executable cannot be directly integrated into a website. You have a few choices though:

  • Allow your users to download the executable and run it locally for themselves
  • Rewrite your program in JavaScript to have it run directly inside of an HTML page, though this could obviously involve a fair amount of reworking
  • Use Microsoft's Silverlight technology, which allows you to code in C# and produce a web-based frontend similar to Adobe Flash. Your program logic should remain the same and you should only have to change the UI code. In fact if you're already using WPF for the front end, the transition will be even easier.
Mark Pim
"a standalone executable cannot be directly integrated into a website" = not sure what that means, but mambo is written in php, and php has an exec function. The proverbial "hello world" standalone executable can be integrated into a php-based web app in one line of code. So, your opening statement is wrong.
Cheeso
@Cheeso "a standalone executable cannot be directly integrated into a website" = you can't just add a (Windows) executable to a webpage (with some magic HTML tag) and, with no exta wrapping, allow full interactivity with it. Yes, PHP has `exec`, but that's run server-side. The most you can do is redirect it's STDOUT to the HTTP response. If the 'guessing game' requires any input (I'm betting it does), either command-line based or GUI, then you'll need some kind of HTTP wrapper code to have an interactive session with the program. This is possible, but not by just adding an exe to a webpage.
Mark Pim
A: 

The short answer to your question is now. I'm presuming that since you're running Mambo you're web environment is a LAMP stack. However, you're "Guessing Game" is most likely a Windows application from the sound of it. For a beginner in programming, there is no integration path you're going to be able to take that will allow you to have your game running on your website.

However, here are avenues you can take, which will require a significant amount of time to learn. I'm not saying you shouldn't take time to learn, by all means you should! I'm simply trying to illustrate the fact that this is not something that is going to be doable in a couple of hours.

  • Silverlight - allows you to run C# code with a WPF like interface on your client's browser and can integrate with your web site through javascript.
  • Let your client download it from your website and run it off of their PC. This would actually be fairly trivial and would be your quickest option, but it sounds like it's not the kind of integration you were looking for.
Joseph
A: 

You may be able to use reflection to load your assembly into the web application, but most likely, the answer is no.

Your best solution is probably to re-write the game in javascript.

John Gietzen
.NET reflection is not gonna work if the web app is Mambo/PHP. And reflection doesn't load an app.
Cheeso
Reflection can load the types in the app, create an instance, and call methods.
John Gietzen
Thanks. I am aware of the capabilities of Reflection. The reason I suggest reflection is not going to be helpful, is that the OP was asking about Mambo/PHP. a PHP app is s not going to be able to load a .NET assembly and start doing Reflection. Reflection is .NET-on-.NET, not PHP-on-.NET.
Cheeso
Ah, I didn't see the part about Mambo. My mistake.
John Gietzen