Library tutorials & articles

.NET Applets

Introduction

This is going to be my first tutorial. It's not final, end-all, documentation on this subject. But it is what I have gotten from Channel9 discussions and online documentation. It will walk you through setting up a .NET Applet.

First of all, what is a .NET Applet? An Applet is basically a small application hosted in a larger application, in this case, the browser. Most common are Java Applets, but they are not the only ones. Items in the Windows Control Panel are called Control Panel Applets. .NET Applets are called that because they resemble Java Applets, but that is not their official name. Generally, the procedure I am about to describe is called ' Hosting Windows Forms controls in Internet Explorer '.

How do you create a .NET Applet? Very basically, you create a Windows Forms user control. That's right, you write Windows Forms code and your browser (Internet Explorer only) handles it. Then you put an <object> tag into your html and specify some information about the Applet (the dll file, namespace, and class).

How does this work? Well, Internet Explorer is able to run .NET controls probably by using COM to host mscoree.dll (If you know more, let me know). If the user/client has the .NET Framework installed, and Internet Explorer 6.0 (I am not sure of 5) your user control will simply be gobbled up and used as a local control.

Security

'Whoa! What is Microsoft doing to us? Think of the hole this could open up!!!', you say. Calm down. It runs in a ‘sandbox'. A special zone that limits what the control can do. It won't let you access local files with the exception of the OpenFileDialog box, and then can only use the dialog box's OpenFile() method. You cannot use the SaveFileDialog. So you don't have to worry about some one messing with your hard drive. (To see which permissions an assembly has for all the different zones, you can go to Control Panel/Administrative Tools/.NET Framework 1.1 Configuration, and then under Runtime Security Policy/Machine/Code Groups/All Code.)

Comments

  1. 01 Feb 2007 at 14:39

    Wath about the interaction of the hosted control with the Javascript? 

    i saw that developing the control in .net 1.1 framework is it possible... but using 2.0 i got some truble...

    do you have more news?!?





  2. 02 Apr 2005 at 03:45

    Very nice and concise. Good work M!

  3. 01 Jan 1999 at 00:00

    This thread is for discussions of .NET Applets.

Leave a comment

Sign in or Join us (it's free).

AddThis

Related discussion

Related podcasts

  • OR Mappers with Michael Plöd

    Podcast (MP3): Download Hosts: &#13;&#10; Arno &#13;&#10; Guests: Michael Plöd Recording venue: In this episode, Michael Plöd is interviewed about Object-Relational Mapping technology. He talks about the common concepts, compares the range of different tools that go by this name, and g...

Events coming up

  • Mar 23

    Microsoft Professional Developers’ Day @ DevWeek 2009

    London, United Kingdom

    Register for PDD before 12 December to receive the Early Bird Discount rate of £169 + VAT. The Professional Developers’ Day (PDD) is a Microsoft exclusive, single-day event designed to give you an early preview of Visual Studio 2010 and .NET Framework V4.0 as unveiled at the 2008 Professional Developers Conference (PDC) in Los Angeles.