How to call a windows application in your website ?
Today, I want to show you how a Windows application can be shown in your Web application or website with out adding any dll's. This is very Interesting to know, I experimented it. This I will demonstrate in this article with snapshots.
Today I want to show you how a Windows application can be shown in your Web application or website with out adding any dll's. This is very Interesting to know, I experimented it using shell commands. I already discuss the reverse process where a webapplication can be shown in windows application in my previous article through webbrowser.dll and cefsharp.dlls . For a newbie in dotnet it is really fascinating to know how to show a windows application in your website.
Let us follow these steps and see the result.
Step 1: First create a Windows Application.
STEP 2: Create sample Win form in which put one label and button and write some code in button click
STEP 3: Execute the Windows Application
STEP 4 : Take the .exe from the Windows application by bin debug folder.
STEP 5: Now put in the Website bin folder or you can create any folder for that matter
Step 6 : Now you have to write the code for the shell commands.
In Windows Application you have to write this code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = "SA WIN T20 WORLD CUP"
Label1.ForeColor = System.Drawing.Color.Green
Next is Website or webapplication you have to write this code
protected void Page_Load(object sender, EventArgs e)
System.Diagnostics.ProcessStartInfo psib =
new System.Diagnostics.ProcessStartInfo("C:\\Documents and Settings\\Administrator\\My Documents\\Visual Studio 2008\\WebSites\\WebSite4\\Bin\\WindowsApplication2.exe");
psib.UseShellExecute = false;
psib.RedirectStandardOutput = true;
psib.RedirectStandardInput = true;
psib.RedirectStandardError = true;
// Start the process
System.Diagnostics.Process proc =
Now the above code is shell command it create a process and execute the exe file on hitting the Dos command prompt and open that exe in website application . Sometimes there may be a scenario that a dll or a component can not be added in your website toolbox and it will get added in your windows application . So you can show this windows application in your website
Below are the screen shots that are taken at real time....
Now see the output as follows
I know what you are curious about, when clicking the button what will happen ? . Yes, I will show you that result through a snapshot. Now I click the button, See the output .
When I was working in Bio Metric Devices company a client Suddenly had arrived to my company it was a urgent requirement the requirement is like this he organised an event in that event he wants to know how many people had attended and how many people had spent their time in the meeting they want to know this through BioMetric device and this they want in Website because the result has to be seen in multiple locations. So when I was adding the BioMetric dll in Website , it was successfully added but giving Single Threaded Apartment exception when calling the predefined function of that .dll , In Windows Application it is successfully added and fetch the data from the device. So I had done this trick and shown to client the client is really impress, and he appreciated me.