By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,320 Members | 2,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,320 IT Pros & Developers. It's quick & easy.

Ending a program

P: n/a
I'm trying to run a program directly from the web.
It's working perfectly, but a simple "End" statement
or "Application.Exit" do not work for me and I get
permission errors.

How can I end a program when running from the web ?
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

End and Application.Exit are pretty serious calls from the sequrity
point of view because they terminate the whole application (vs. just one
app domain). In a case when multiple apps running in the same host, such
call will try to terminate _all_ apps and therefore these calls require
additional priveleges that are not granted when code runs in semi-trusted
environment. When you run code from a website the code is running in such
secure environment and that's why you get permission errors.
If your app is a singlethreaded app (you do not start additional
threads), in order to exit your code just needs to return from your Main
function. That would be most correct and graceful termination. An unhandled
exception will do this too, but this is somewhat less gracefull, brute
force way to do the same. In multithreaded case all threads should exit.

Vladimir [VB.Net team]
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "Ricky" <rv*****@mail.com>
| Sender: "Ricky" <rv*****@mail.com>
| Subject: Ending a program
| Date: Mon, 15 Sep 2003 09:34:33 -0700
| Lines: 6
| Message-ID: <44****************************@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcN7pz5WTNw9bzxJQ7GjD4hnBqhz4A==
| Newsgroups: microsoft.public.dotnet.languages.vb
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:137053
| NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| I'm trying to run a program directly from the web.
| It's working perfectly, but a simple "End" statement
| or "Application.Exit" do not work for me and I get
| permission errors.
|
| How can I end a program when running from the web ?
|

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.