Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you open Notepad.exe via ASP.NET web form ?

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
Is it possible to open a common Windows application (something like NotePad.exe of WordPad.exe) by clicking a button in an ASP.NET web form.
I know it's a simple thing via C# Windows programming, the syntax being :
System.Diagnostics.Process.Start(@"C:\Windows\Notepad.exe");
Is the same achievable in ASP.NET (C#) code ?
I can't seem to make it happen ... :(
Any thoughts ?
Thanks in advance
Steve
 
Do you need to run this process on the server?

Does it matter if it runs in the background... IE no one will see it?
 
The process needs to run on the client machine.
I need it to save / open a text file and print it perhaps.
Steve
 
This can't be done via server side controls.. (to my knowledge)
For client side, you will need either to use Client Side sctipting (DHTML) which will probably not have permissions to run a program, open files or save files (as that is what most virus's like to do). If this is an intranet app. then you could probably have internal security (intranet zone) lowered in all the client browsers, but that would scare me in todays world of virus's.

Another option would be something like activeX. as the browser can't check what the nasty little piece of code will do. It would there fore be able to open/save files on a Pc's harddrive. (you aren't writing virus's are you? they suck!!!). However you will probably need to get a digital certificate to prove you aren't a nasty person (or hope everyones browser has stupid settings for security)..

HTH

Rob
 
No I'm not writing viruses. I'm one of the good guys. :)
How would I make use of the digital certificate ?
Someone else has mentioned this and I think I'm going to need to read up on it one evening.....
Steve
 
The first thing you will need is go get a Digital Certificate. There are a number of 3rd party's that will sell you one. This would be groups like thwart and verisign (I think MS will also sell you one) but these things cost$$$

If you are running certificate services you can issue you own. (they just won't have the fancy issued by "BIG KNOWN COMPANY" stamp on them when presented by the client browser.

I must admit to only doing this in VB5 and 6. I am not sure about how .Net would handle building activex controls. But in 6 you would specify (during the build of a setup app) that the code was safe for scripting and safe for initializing. (this is an honesty box. you are just saying you will be nice, it does't limit what your control can do, however if you don't it wont respond to dhtml) you woulnd also specify the your certificate here (from memory) been a while..


HTH


Rob
 
Just a random thought - if you are doing something like launching notepad, then you are already relying on the user running windows. If they also have .net framework installed, and since you seem comfortable at C# winforms, then is No Touch Deployment, or One Click, an option?


Mark [openup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top