Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Using Windows Application on web

0.00/5 (No votes)
29 May 2006 1  
This article gives you brief idea of how to run your windows application web

"mso-bidi-font-weight: normal">Introduction

 

This article will helps you to run Windows Application on Web

 

Note:

                Try to use the Microsoft windows control, Avoid third party control.

                Because we are going to use the same control on web

 

"mso-bidi-font-weight: normal">Advantages:

 

Reduces the coding time and resource needed for web

Bring the desktop to your web

 

 

"mso-bidi-font-weight: normal">Requirement:

 

Develop a windows application .For developing weather you can use windows controls

are third party control that�s not a matter.

 

"mso-bidi-font-weight: normal">Process:

 

1.open  "New Project "  select Visual C# Project  and select windows application  and

name the project as  'WindowsTOWeb' and click open (Ref :Figure 1)

Sample screenshot

           2. Design the form as shown in the (Ref: figure 2)

Sample screenshot 

 

           3. When you run the form the form will look like this in windows (Ref: Figure 3)

Sample screenshot          

4. Now we want to convert the windows application in to a usercontrol to convert the windows

 application in to user control we need to follow the following steps

I> Convert the

                    public class Form1 : System.Windows.Forms.Form

                                                   TO

                   public class Form1 : System.Windows.Forms.UserControl

  (Ref: Figure 4)

Sample screenshot

II> Comment the 

                        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

Of the windows

 

Now your windows form application is converted to user control

 

5. Now click the property of the project and change the �Output Type" from Windows

Application to Class Library (Ref: Figure 5)

Sample screenshot

6. Before compiling the project comments the "thread" (Ref: Figure 6)

 

 

Sample screenshot

Now You have successfully created the user control

 

7. Now add web application in the same solution it self (Ref: Figure 7)

Sample screenshot 

8. Now create a strong name for your user control by using "sn.exe " which is in the location

'C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin'.The syntax for creating the

string name is

"C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\sn -k "C:\Strongname.snk"

now the strong name has been created and it is in the c: in the name of strongname.snk

 

9. After creating the strong name specify the path of the strong name in "Assemblyinfo.cs "

file in the [assembly: AssemblyKeyFile("c:\strongname.snk")] attribute

 

Now the first way of using the user control in the web

 

10. Now by using the "regasm.exe" create and place the CLSID of your dll in the registry

the exe file which is in the location "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\ ".

 

11. Then by using the Gacutil.exe register your WindowsToWeb .dll the the registry

 Then go to the registry and search by the name "WindowsToWeb.dll" and copy the CLSID to the

code behind as Specified in the figure (Ref: Figure 8)

 

Sample screenshot

 

12. Now you can see the windows control in the web form (Ref: figure 9)

 

Sample screenshot

13. Run your web application. Congrats your windows control is now on web

Sample screenshot 

 

"mso-bidi-font-weight: normal">Conclusion:

 

            This is the sample application which I have created when I am in position to run

the windows application which I have created on web page. By using this you

can run only the simple application  

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here