.NET Forum / ASP.NET / General / August 2007
Calling a windows application from inside the browser
|
|
Thread rating:  |
Tamer Ibrahim - 31 Jul 2007 19:31 GMT Hello, Can I call, run, a windows application from my web application when the user fires a certain event ? Thank You.
Mark Rae [MVP] - 31 Jul 2007 19:38 GMT > Can I call, run, a windows application from my web application when the > user fires a certain event ? Not natively - imagine if you could run format c: from behind a button...
:-) OK, that's a bit of an extreme example, but you get the idea... :-) You could use something like WSH (or a bespoke ActiveX control) for this, but you would also reduce your browser security settings... Obviously this would limit you to IE, so no use at all for a public website...
 Signature Mark Rae ASP.NET MVP http://www.markrae.net
Tamer Ibrahim - 01 Aug 2007 09:42 GMT Thank you for your reply but I have no idea what WSH is.
>> Can I call, run, a windows application from my web application when the >> user fires a certain event ? [quoted text clipped - 5 lines] > but you would also reduce your browser security settings... Obviously this > would limit you to IE, so no use at all for a public website... Mark Rae [MVP] - 01 Aug 2007 10:09 GMT > Thank you for your reply but I have no idea what WSH is. Windows Scripting Host.
However, I'd strongly advise you not to even try to do this - one of the main security features of all modern Internet browsers is geared specifically to preventing this sort of activity...
 Signature Mark Rae ASP.NET MVP http://www.markrae.net
Tamer Ibrahim - 01 Aug 2007 12:54 GMT It is an intranet application. Browser security issues can be arranged with the customer. So, how can I accomplish the required task with Active X, WSH or any other way.
>> Thank you for your reply but I have no idea what WSH is. > [quoted text clipped - 3 lines] > main security features of all modern Internet browsers is geared > specifically to preventing this sort of activity... Mark Rae [MVP] - 01 Aug 2007 13:26 GMT > It is an intranet application. Browser security issues can be arranged > with the customer. Again, I would strongly advise you not to do this...
> So, how can I accomplish the required task with Active X, WSH or any other > way. http://www.faqts.com/knowledge_base/view.phtml/aid/31646/fid/124
 Signature Mark Rae ASP.NET MVP http://www.markrae.net
Juan T. Llibre - 31 Jul 2007 19:41 GMT re: !> Can I call, run, a windows application from my web application when the user fires a certain event ?
Yes.
Juan T. Llibre, asp.net MVP asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ ======================================
> Hello, > Can I call, run, a windows application from my web application when the user fires a certain event ? > Thank You. Tamer Ibrahim - 01 Aug 2007 09:44 GMT How ?
> re: > !> Can I call, run, a windows application from my web application when the [quoted text clipped - 10 lines] >> user fires a certain event ? >> Thank You. Juan T. Llibre - 01 Aug 2007 12:16 GMT Use System.Diagnostics.Process.Start()
The executable will run as the ASP.NET account, so the ASP.NET account will need whichever permissions the process needs.
Juan T. Llibre, asp.net MVP asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ ======================================
> How ? >> re: [quoted text clipped - 9 lines] >>> Can I call, run, a windows application from my web application when the user fires a certain event ? >>> Thank You. Mark Rae [MVP] - 01 Aug 2007 13:26 GMT > Use System.Diagnostics.Process.Start() > > The executable will run as the ASP.NET account, > so the ASP.NET account will need whichever permissions the process needs. I interpreted the OP as wanting to run a Windows app client-side...
 Signature Mark Rae ASP.NET MVP http://www.markrae.net
Tamer Ibrahim - 01 Aug 2007 14:50 GMT Yes, I want to run a Windows app on client-side...
I have created a test web site consists of one page and here is its code : protected void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.Process p = new System.Diagnostics.Process();
p = System.Diagnostics.Process.Start("IExplore.exe");
}
It is not working and no exception appears ..!!
>> Use System.Diagnostics.Process.Start() >> >> The executable will run as the ASP.NET account, >> so the ASP.NET account will need whichever permissions the process needs. > > I interpreted the OP as wanting to run a Windows app client-side... Mark Rae [MVP] - 01 Aug 2007 15:03 GMT > Yes, I want to run a Windows app on client-side... That's what I thought, though you didn't specify that in your original post...
> It is not working and no exception appears ..!! It won't work, because it is trying to run Internet Explorer on your webserver...
Can you please explain *precisely* what you're trying to do here...
 Signature Mark Rae ASP.NET MVP http://www.markrae.net
Tamer Ibrahim - 01 Aug 2007 15:24 GMT Here is what I'm trying to do. Calling this windows application, Archiving.exe, on the client side ....
protected void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.Process p = new System.Diagnostics.Process();
p = System.Diagnostics.Process.Start(@"C:\Program Files\The Pen IT\Archiving System\Archiving.exe");
}
>> Yes, I want to run a Windows app on client-side... > [quoted text clipped - 7 lines] > > Can you please explain *precisely* what you're trying to do here... Mark Rae [MVP] - 01 Aug 2007 15:37 GMT > Here is what I'm trying to do. Calling this windows application, > Archiving.exe, on the client side ....
> System.Diagnostics.Process p = new System.Diagnostics.Process(); I already told you that won't work - that is server-side code, not client-side code.
I've already provided you with a link showing you how to do this client-side - here it is again: http://www.faqts.com/knowledge_base/view.phtml/aid/31646/fid/124
 Signature Mark Rae ASP.NET MVP http://www.markrae.net
Juan T. Llibre - 01 Aug 2007 16:08 GMT re: !> I interpreted the OP as wanting to run a Windows app client-side...
I wish him good luck with that chore if that what he wants.
An ActiveX object would be the first thing to try but I, like you, discourage their use given the security issues.
Users have to approve the installation of any ActiveX object ...and that is enough to cause problems.
The whole idea of the .Net Framework is *not* to do client-side processing, except for UI actions and notifications which use Javascript, for which Ajax is the ideal vehicle, although it will *not* run executables client-side either.
Juan T. Llibre, asp.net MVP asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ ======================================
>> Use System.Diagnostics.Process.Start() >> >> The executable will run as the ASP.NET account, >> so the ASP.NET account will need whichever permissions the process needs. > > I interpreted the OP as wanting to run a Windows app client-side... Mark Rae [MVP] - 01 Aug 2007 16:18 GMT > re: > !> I interpreted the OP as wanting to run a Windows app client-side... [quoted text clipped - 13 lines] > is the ideal vehicle, although it will *not* run executables client-side > either. Indeed - I've already advised him twice not to do this...
 Signature Mark Rae ASP.NET MVP http://www.markrae.net
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|