SpriteHand
Module Border
  WindowsForms instead of ASP.NET?
Module Border
Location: BlogsAndy's Blog    
Posted by: host 9/26/2004 8:39 PM

Don't get me wrong, ASP.NET applications rock. But there are still many applications that don't fit well in an HTML and HTTP world because of complex state management and user interface requirements. Additionally, many enterprises don't have the skilled developers to quickly complete a web project.

But what if you could create a WindowsForms project, make it easily deployable, and not have to worry about configuring .NET security on the client to get your users to run?

Well, if you can guarantee that your users will have the .NET Framework version 1.1 or better, then you can accomplish your goals of easy deployment using WindowsForms, Internet Explorer, and Web Services. Note that by default there are severe security restrictions on WindowsForms applications executed within Internet Explorer using this method. But it is acceptable for an embedded WindowsForms application to call web services on the same server that the assembly was downloaded from. So as long as you can wrap your business classes in a web service, you can proceed....

Here's a quick step-by-step to get a WindowsForms app deployed through your web server, and embedded into IE:

1. Create your WindowsForms Interface
You will need to create a User Control to contain your WindowsForms User Interface.

2. Create your Web Site
Create a new ASP.NET Web Application and add an ASPX page to host your User Control created in Step 1.  Also add a new Web Service (.asmx) file and implement any server side (business logic) classes. Copy the assembly containing your User Control (from Step 1) to your web directory. Don't put it in the bin directory as this will likely cause security problems when the client attempts to download.

Now you can add a tag in your ASPX page to embed the user control. It follows a syntax like so:

<OBJECT id=MyControl height=640 width=480 classid=“http:MyUserControlAssembly.dll#MyUserControlNamespace.MyUserControlClassName“></OBJECT>

Note that the “http:” prefix will cause the assembly to be download from the same web directory that the ASPX page exists in.

3. Backtrack and call the web service
Now that you created a web service in Step 2, you can go back to your WindowsForms User Control and add a reference to it. Since the release of the .NET Framework 1.1, any user can call a web service from a downloaded WindowsForms assembly. But note that this did not work in version 1.0 of the framework.

Permalink |  Trackback

Title:
Comment:
Add Comment   Cancel 
Module Border Module Border
Module Border
  Blog_List
Module Border
Module Border Module Border
Module Border
  Subscribe
Module Border

RSS

Module Border Module Border
Module Border
  Diversions
Module Border

DESTROY ALL INVADERS
A scrolling shooter game where the objective is to destroy the invading UFO's flying over a neighborhood of your choosing. Imagery provided by Microsoft Virtual Earth. Created using Silverlight 2.
PLAY IT

INFO AND CODE



HOOK SHOT
This little basketball game was submitted as an entry to the TeamZoneSports Silverlight Contest. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

INFO AND CODE



SORT THE FOOBARS
A game where you need to sort the good foobars from the bad ones. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

MORE INFO



POLYGON PHYSICS DEMO
A demo showing polygon physics where the user draws physics objects with the mouse. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

MORE INFO



SILVERLIGHT ROCKS!
Destroy the asteroids before they destroy your ship! Created using Silverlight 2.
PLAY IT

INFO AND CODE



FISH GAME
A simple game of harpoon-the-fish. Written using the AJAX Sprite Toolkit.
PLAY IT

INFO AND CODE

Module Border Module Border
Module Border
  Search_Blog
Module Border
Module Border Module Border
Module Border
  Blog_Archive
Module Border
Module Border Module Border
Copyright (c) 2008 andy.beaulieu.com - Login