Click here to Skip to main content
12,893,816 members (55,213 online)
Click here to Skip to main content
Add your own
alternative version

Stats

86.5K views
26 bookmarked
Posted 29 May 2006

Using Windows Application on web

, 29 May 2006
Rate this:
Please Sign up or sign in to vote.
This article gives you brief idea of how to run your windows application web

Introduction

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> 

This article will helps you to run Windows Application on Web

<o:p> 

Note:<o:p>

                Try to use the Microsoft windows control, Avoid third party control.<o:p>

                Because we are going to use the same control on web<o:p>

<o:p> 

Advantages:

<o:p> 

Reduces the coding time and resource needed for web<o:p>

Bring the desktop to your web<o:p>

<o:p> 

<o:p> 

Requirement:

<o:p> 

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

are third party control that’s not a matter.<o:p>

<o:p> 

Process:

<o:p> 

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

<o:p>

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

Sample screenshot 

<o:p> 

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

Sample screenshot          

<o:p>

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

<o:p>

I> Convert the <o:p>

                    public class Form1 : System.Windows.Forms.Form<o:p>

                                                   TO<o:p>

                   public class Form1 : System.Windows.Forms.UserControl<o:p>

  (Ref: Figure 4)

Sample screenshot

II> Comment the  <o:p>

                        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<o:p>

Of the windows

<o:p> 

Now your windows form application is converted to user control <o:p>

<o:p> 

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

Application to Class Library (Ref: Figure 5)

<o:p>

<o:p>

Sample screenshot

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

 

 

Sample screenshot

Now You have successfully created the user control <o:p>

<o:p> 

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

<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"><v:f eqn="sum @0 1 0"><v:f eqn="sum 0 0 @1"><v:f eqn="prod @2 1 2"><v:f eqn="prod @3 21600 pixelWidth"><v:f eqn="prod @3 21600 pixelHeight"><v:f eqn="sum @0 0 1"><v:f eqn="prod @6 1 2"><v:f eqn="prod @7 21600 pixelWidth"><v:f eqn="sum @8 21600 0"><v:f eqn="prod @7 21600 pixelHeight"><v:f eqn="sum @10 21600 0"><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"><o:lock aspectratio="t" v:ext="edit">

<v:shapetype stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><o:lock aspectratio="t" v:ext="edit">Sample screenshot 

<v:shapetype stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><o:lock aspectratio="t" v:ext="edit">

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

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

string name is <o:p>

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

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

<o:p> 

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<o:p>

<o:p> 

Now the first way of using the user control in the web <o:p>

<o:p> 

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\ ".<o:p>

<o:p> 

11. Then by using the Gacutil.exe register your WindowsToWeb .dll the the registry<o:p>

 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)

<o:p> 

<v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"><v:f eqn="sum @0 1 0"><v:f eqn="sum 0 0 @1"><v:f eqn="prod @2 1 2"><v:f eqn="prod @3 21600 pixelWidth"><v:f eqn="prod @3 21600 pixelHeight"><v:f eqn="sum @0 0 1"><v:f eqn="prod @6 1 2"><v:f eqn="prod @7 21600 pixelWidth"><v:f eqn="sum @8 21600 0"><v:f eqn="prod @7 21600 pixelHeight"><v:f eqn="sum @10 21600 0"><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"><o:lock aspectratio="t" v:ext="edit">

Sample screenshot

 

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

 

Sample screenshot

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

<o:p>

<o:p>Sample screenshot 

<o:p> 

<o:p>

Conclusion:

<o:p> 

            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  

<o:p> 

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

Share

About the Author

as_prabahar
Web Developer
United States United States
I am Prabakar working as Software Engineer .I had been working in Microsoft Platform for the past 3+ years.I have also completed MCP.

You may also be interested in...

Pro

Comments and Discussions

 
QuestionConversion Of windows Application to a Web Application Pin
Member 1308701027-Mar-17 2:34
memberMember 1308701027-Mar-17 2:34 
QuestionDoubt in Step 10 Pin
Sibeesh Passion21-Jan-16 0:37
professionalSibeesh Passion21-Jan-16 0:37 
QuestionUnable to create Pin
wrappingduke9-Jan-14 12:00
memberwrappingduke9-Jan-14 12:00 
QuestionStuck at 8 step Pin
DSrini11-Jun-13 0:10
memberDSrini11-Jun-13 0:10 
QuestionAfter step 13 Pin
shyam.vegeta14-Mar-13 5:54
membershyam.vegeta14-Mar-13 5:54 
Hi,
After step 13, i need to get values of a listbox in windows form shown in the aspx page in an another page..
how can i get the contents of the listbox for further flow of web application
QuestionProblem at step 8 Pin
Hhiren13-Feb-12 1:40
memberHhiren13-Feb-12 1:40 
QuestionHi Pin
Member 772166127-Jun-11 5:07
memberMember 772166127-Jun-11 5:07 
QuestionHI Pin
Member 772166127-Jun-11 4:22
memberMember 772166127-Jun-11 4:22 
QuestionWhy i cannot find CSLID in registry ? Pin
wcwong221-May-10 18:56
memberwcwong221-May-10 18:56 
GeneralThanks to all Pin
Prabakar Samiyappan3-Nov-08 22:57
memberPrabakar Samiyappan3-Nov-08 22:57 
Questionneed help for do this procedure.doubt on 10th and 11th steps. Pin
Alexisraj29-Sep-08 23:43
memberAlexisraj29-Sep-08 23:43 
GeneralFirefox the windows form is not displaying Pin
Lakshmi Sunitha10-Apr-08 1:58
memberLakshmi Sunitha10-Apr-08 1:58 
GeneralUsing Windows Application on web Pin
Ezhil_yoga26-Nov-07 20:22
memberEzhil_yoga26-Nov-07 20:22 
GeneralRe: Using Windows Application on web Pin
Alexisraj30-Sep-08 0:22
memberAlexisraj30-Sep-08 0:22 
GeneralCLSID set up Pin
MyDays12-Mar-07 13:07
memberMyDays12-Mar-07 13:07 
General.exe files for web application Pin
MyDays12-Mar-07 11:14
memberMyDays12-Mar-07 11:14 
QuestionStuck at Step 11 Pin
Mihir_999_78617-Oct-06 12:28
memberMihir_999_78617-Oct-06 12:28 
GeneralStrong name Pin
AndyHug8-Jun-06 20:45
memberAndyHug8-Jun-06 20:45 
GeneralStopped at step no 10 Pin
AndyHug7-Jun-06 22:46
memberAndyHug7-Jun-06 22:46 
GeneralRe: Stopped at step no 10 Pin
AndyHug7-Jun-06 23:40
memberAndyHug7-Jun-06 23:40 
GeneralRe: Stopped at step no 10 Pin
asprabahar8-Jun-06 7:14
memberasprabahar8-Jun-06 7:14 
QuestionRe: Stopped at step no 10 Pin
dotguru26-Jul-06 2:57
memberdotguru26-Jul-06 2:57 
AnswerRe: Stopped at step no 10 Pin
E. H.1-Aug-06 6:04
memberE. H.1-Aug-06 6:04 
GeneralRe: Stopped at step no 10 Pin
asprabahar28-Sep-06 1:10
memberasprabahar28-Sep-06 1:10 
GeneralRe: Stopped at step no 10 Pin
asprabahar8-Jun-06 7:16
memberasprabahar8-Jun-06 7:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 29 May 2006
Article Copyright 2006 by as_prabahar
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid