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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing Applications from Webforms

Status
Not open for further replies.

AtariJag64

Programmer
Mar 4, 2002
8
US
I want to open up a windows application (*.exe file) from a webform.

Does anyone know the code for this?

I've tried:
System.Diagnostics.Process.Start(fileName);

but this doesn't seem to do anything.

Any suggestions?

Thanks,
-Chris B.


 
I'm guessing you're trying to do this on a user's machine?

If so, there are many security checks you must pass first. Unlike the old days of OCX programming where if you implemented the "I'm a safe control" COM interface(don't remember the actual name), .NET will not allow you to do things like access the local harddrive that you used to be able to.

There was an article three months ago in MSDN Magazine which talks about the security zones used in .NET programming. IIRC, there's the Enterprise zone, Group zone, and Local Machine zone. The permissions are subtractive, meaning that if the Enterprise zone forbids something, you can't override it locally.

Chip H.
 
it's true... i've already tried it... we can't pass through user's local machine security checks.

actually there's another way to run executable files in your client's local machine, but this can't pass through your client's security checks either. i suggest that you use the asp.net <object> tag to attach your browser with a downloadable winform, while in your winform's on load events you write down this code :

System.Reflection.Assembly.LoadFrom(YOUR WINFORM DLL's URL);

and after that you can just create new instance of your winform class and told your form to show() or anything else :), but remember you should use the :

System.Reflection.Activator.CreateInstance(typeof(winformclass));

to create new instance of your winform class cause you get the assembly at runtime, not design time :).

but anyway, you must told your client to trust your assembly, and told him to enable activeX, if not there will be a messagebox appearing telling you that you don't have permissions blablabla :)

anyway, i've just tried this downloadable winform once, so if you guys have a better way, please tell me i'll be very grateful :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top