ASP.NET - integrate windows form with application

Asked By anbu n on 02-Oct-11 10:14 PM
i need to integrate some kind of windows form or windows application in web application

because i need to find the local physical path of client where my web application runs so  i planning implement a mini windows application run s in client machine when user works with web application
Sakshi a replied to anbu n on 02-Oct-11 10:42 PM

1. create your windows application with .exe
2. create web app separately
3. call your windows app exe from web app using

Diagnostics.Process.Start(path of exe);
Mihir Soni replied to anbu n on 02-Oct-11 11:05 PM

Here is simple solution what other websites do is to either use ACTIVEex control which is very simple solution.

Now Here is another example.

Whenever users visit your website make sure some required files has been installed in their machines.

Like when we do video/audio chat in gmail we are suppose to install plugin through which we will be able to do this.

Hope this helps you

Thank you.

Anoop S replied to anbu n on 03-Oct-11 12:27 AM
if you want host Windows Forms Control you need to create Windows Control Library , refer this steps

we will first create a simple Windows application, and I'll show you later on in this tutorial how I will embed it within our page. We will use Windows Control Library instead of a new Windows application.
Open up visual studio, press File-->New-->Project.
Choose "Windows Control Library" and leave the other default settings.

In the control library, insert a label into your form and save your changes.
Make sure you Debug the project because we will need the dll file produced to be used within our web application.

Now close the solution and create a new website.
To do so, press File-->New-->Website. Give your site a name. Mine is web_project.

Now you will need your dll file produced in the previous project, copied to where your website is.
Usually, you should locate your dll file in "bin" folder of your project. Copy that dll and place it in the root of the website.

Now go back to your website in visual studio, and get the HTML code of the Default.aspx page.
Add the following code within the "form" tag:

<!-- Code Starts Here -->
<object id="myName" classid="http:WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1"
height="70" width="350" VIEWASTEXT/>
<!-- Code Ends Here -->

Save your changes and Run the site. An alert will be prompted to you asking wether to trust the dll file or not.

Click Run to allow the dll to be launched in Internet Explorer.
This will load the dll file to your web page. It should look something like image below:

Reena Jain replied to anbu n on 03-Oct-11 01:43 AM

It is possible to host a Windows Form Control in a Web Page and run it from within Internet Explorer. This allows to build powerful client side functionality with all the advantages of using the .Net framework and executing the control in the client side. Of course there are some restrictions that cannot be left aside. At least the .Net framework must be installed on the client for the control to run. In addition, it is possible that some permission must be granted to the control, too, depending on the actions the control will take on the client machine.

check this for more information
anbu n replied to Anoop S on 04-Oct-11 01:58 AM

i,ve followed all the steps to add windows library control , but it does not seems to work , i can t see the label  or text box i.e,  windows user control.... in my web application where i ,ve added the WindowsFormsControlLibrary1.dll

here is the below code i,ve added in my aspx page, in my  web application , this user control has textbox & label

    <!-- Code Starts Here -->
                <object id="myName" classid="http:WindowsFormsControlLibrary1.dll#WindowsFormsControlLibrary1.UserControl1"
                  height="70" width="350" viewastext />
                <!-- Code Ends Here -->