Running winform Exe from Web Application | | |
Hi ,
I am doing some experimentation , so i created a winform exe , that on
load event creates a NotifyIcon object for System Tray Icon . Now if i
run that application normally by VS.net or double click , it works as
expected and can be debugged .
Now , i created a Web App. containing a button , which invokes the
winform exe using System.Diagnostics --> Process class .
Something lke :
System.Diagnostics.Process.Start(<Filename>) ;
where <filename> is a local drive path , where Web App. is running ,
something like @"C:\MyApp\app.exe" , but in this case it gives an
exception -- "File not found" , i was not able to understand reason for
this , so i copied the same exe in the virtual directory folder for
webApp , something like "C:\inetpub\wwwroot\MyWebApp\app.exe" .
Now this thing is able to execute the application fine , Can anybody
guess the reason for the issue .
Now major problem comes , since it is executing an exe , so i did
expected as a normal double click behaviour , executing the load event
and creating an icon in system tray , but no such thing happened ,
apparentely , if seen in TaskManager , then a process is running and as
many number of times , i click the button on web form , a process gets
added , but no load event execution .
Now i added some MessageBox.show in load event to cross check , but they
didn't triggered , confirming no execution of event .
Can anybody help me in giving relevant info in this case . Also for
processes triggered through that web application , if i try killing from
task manager , it doesn't , saying "access denied" and there's no other
way except machine shutdown . In case you need some more information let
me know that .
thanks ,
Mrinal | | | | re: Running winform Exe from Web Application
Hi,
You cannot do it like that, in fact you cannot do it at all, think, what
would happen if the client is in a different machine that the server?
the app would be executed in the server and not in the client.
Most probably there will be nobody logged in the server, so there will be
not a desktop anyway.
what are you trying to do?
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Mrinal Kamboj" <mrinal.kamboj@oracle.com> wrote in message
news:fbfTe.21$wj7.163@news.oracle.com...[color=blue]
> Hi ,
>
> I am doing some experimentation , so i created a winform exe , that on
> load event creates a NotifyIcon object for System Tray Icon . Now if i run
> that application normally by VS.net or double click , it works as expected
> and can be debugged .
>
> Now , i created a Web App. containing a button , which invokes the winform
> exe using System.Diagnostics --> Process class .
>
> Something lke :
>
> System.Diagnostics.Process.Start(<Filename>) ;
>
> where <filename> is a local drive path , where Web App. is running ,
> something like @"C:\MyApp\app.exe" , but in this case it gives an
> exception -- "File not found" , i was not able to understand reason for
> this , so i copied the same exe in the virtual directory folder for webApp
> , something like "C:\inetpub\wwwroot\MyWebApp\app.exe" .
>
> Now this thing is able to execute the application fine , Can anybody guess
> the reason for the issue .
>
> Now major problem comes , since it is executing an exe , so i did expected
> as a normal double click behaviour , executing the load event and creating
> an icon in system tray , but no such thing happened , apparentely , if
> seen in TaskManager , then a process is running and as many number of
> times , i click the button on web form , a process gets added , but no
> load event execution .
>
> Now i added some MessageBox.show in load event to cross check , but they
> didn't triggered , confirming no execution of event .
>
> Can anybody help me in giving relevant info in this case . Also for
> processes triggered through that web application , if i try killing from
> task manager , it doesn't , saying "access denied" and there's no other
> way except machine shutdown . In case you need some more information let
> me know that .
>
> thanks ,
>
> Mrinal[/color] | | | | re: Running winform Exe from Web Application
Hi ,
I can understand your point , but then are you saying that this is not a
right thing to do or it's not possible , to execute an exe from a web
App. even if i am doing it on same machine , as i had mentioned i am not
able to obtain the same results as double click . We can forget the Path
related issues for time being .
thanks ,
Mrinal
Mrinal
Ignacio Machin ( .NET/ C# MVP ) wrote:
[color=blue]
> Hi,
>
> You cannot do it like that, in fact you cannot do it at all, think, what
> would happen if the client is in a different machine that the server?
> the app would be executed in the server and not in the client.
> Most probably there will be nobody logged in the server, so there will be
> not a desktop anyway.
>
> what are you trying to do?
>
> cheers,
>[/color] | | | | re: Running winform Exe from Web Application
Hi Mrinal,
I agree with Ignacio that you cannot do this. This is not the right thing
to do and also impossible. Because the asp.net working process is a service
process, it does not interact with the user interface. So your every try to
show a message box or icon is failed.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights." |  | Similar C# / C Sharp bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,501 network members.
|