Is there anyway to stop the application starting during the
Application_Sta rt event in the Global.asax.cs file? I want to check a
license key at this point and not let the application start if it's
invalid. I've tried throwing an exception but that doesn't seem to
have any affect.
Thanks,
Rob. 7 1573
Hi,
Why not ersponse redirect it if the license key is incorrect?
Yama
<we*****@gmail. com> wrote in message
news:52******** *************** ***@posting.goo gle.com... Is there anyway to stop the application starting during the Application_Sta rt event in the Global.asax.cs file? I want to check a license key at this point and not let the application start if it's invalid. I've tried throwing an exception but that doesn't seem to have any affect.
Thanks, Rob.
That would only intercept the first user on the first visit.
You could go further with that and also incorporate logic into the
session_onstart that checks to see if an application variable was set and
redirect there also. However, if you are looking for a registration key or
something, does that mean that the files are hosted on the client's server?
If so, how are you blocking them from just editing the global.asa and
removing the check?
Thanks,
Ian Suttle http://www.IanSuttle.com
"Yama" wrote: Hi,
Why not ersponse redirect it if the license key is incorrect?
Yama
<we*****@gmail. com> wrote in message news:52******** *************** ***@posting.goo gle.com... Is there anyway to stop the application starting during the Application_Sta rt event in the Global.asax.cs file? I want to check a license key at this point and not let the application start if it's invalid. I've tried throwing an exception but that doesn't seem to have any affect.
Thanks, Rob.
Have Session_OnStart check an Application flag, and take appropriate action
Jeff
<we*****@gmail. com> wrote in message
news:52******** *************** ***@posting.goo gle.com... Is there anyway to stop the application starting during the Application_Sta rt event in the Global.asax.cs file? I want to check a license key at this point and not let the application start if it's invalid. I've tried throwing an exception but that doesn't seem to have any affect.
Thanks, Rob.
Hi Rob,
Application_Sta rt might not be the best choice since it will only fire once
when the app starts. I don't think there's a way of making the app not
load - throwing an exception there will likely have some unexpected results.
A better approach might be to use Application_Beg inRequest or hooking up
something inside of a custom page class (avoids somebody messing with
Global.asax), or hooking up a custom HttpModule dynamically at runtime (or
chaining Global.BeginReq uest).
+++ Rick ---
--
Rick Strahl
West Wind Technologies http://www.west-wind.com/ http://www.west-wind.com/weblog/ http://www.west-wind.com/wwThreads/
----------------------------------
Making waves on the Web
<we*****@gmail. com> wrote in message
news:52******** *************** ***@posting.goo gle.com... Is there anyway to stop the application starting during the Application_Sta rt event in the Global.asax.cs file? I want to check a license key at this point and not let the application start if it's invalid. I've tried throwing an exception but that doesn't seem to have any affect.
Thanks, Rob.
"Rick Strahl [MVP]" <ri********@hot mail.com> wrote in message news:<eo******* *******@TK2MSFT NGP10.phx.gbl>. .. Hi Rob,
Application_Sta rt might not be the best choice since it will only fire once when the app starts. I don't think there's a way of making the app not load - throwing an exception there will likely have some unexpected results.
A better approach might be to use Application_Beg inRequest or hooking up something inside of a custom page class (avoids somebody messing with Global.asax), or hooking up a custom HttpModule dynamically at runtime (or chaining Global.BeginReq uest).
+++ Rick ---
I figured if I couldn't stop the application in the application load
then I'd have to use Application_Beg inRequest. Now can I throw a 500
error in this or can I only do redirects?
Thanks,
Rob.
Try my suggestion. I have it working here.
Jeff
<we*****@gmail. com> wrote in message
news:52******** *************** ***@posting.goo gle.com... "Rick Strahl [MVP]" <ri********@hot mail.com> wrote in message
news:<eo******* *******@TK2MSFT NGP10.phx.gbl>. .. Hi Rob,
Application_Sta rt might not be the best choice since it will only fire
once when the app starts. I don't think there's a way of making the app not load - throwing an exception there will likely have some unexpected
results. A better approach might be to use Application_Beg inRequest or hooking up something inside of a custom page class (avoids somebody messing with Global.asax), or hooking up a custom HttpModule dynamically at runtime
(or chaining Global.BeginReq uest).
+++ Rick ---
I figured if I couldn't stop the application in the application load then I'd have to use Application_Beg inRequest. Now can I throw a 500 error in this or can I only do redirects?
Thanks,
Rob.
I see you've considered session solutions.
Perhaps in Application_Sta rt you could actually change the IIS user context
to an invalid account? The application could not start the next time with
an invalid service account
Jeff
<we*****@gmail. com> wrote in message
news:52******** *************** ***@posting.goo gle.com... Is there anyway to stop the application starting during the Application_Sta rt event in the Global.asax.cs file? I want to check a license key at this point and not let the application start if it's invalid. I've tried throwing an exception but that doesn't seem to have any affect.
Thanks, Rob. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: wolftor |
last post by:
If I change the application title, it appears to change OK during the
current session; but if I exit Access 97 and then run the application again,
the change did not get saved. Any idea how to fix this and what's causing
it?
--
Regards,
Peter
|
by: orekin |
last post by:
Hi There
I have been trying to come to grips with Application.Run(),
Application.Exit() and the Message Pump and I would really appreciate
some feedback on the following questions .. There are quite a few
words in this post but the questions are actually quite similar and
should be fairly quick to answer ...
(1) What is Happening with the Threads
|
by: billr |
last post by:
I have developed a small API for taking care of a lot of boiler plate stuff
in a multi formed windows application, for example setting up a messaging
thread framework.
New Forms, in the appllication using the API, are subclassed to a Form
contained within the API, and they are controlled (controlled in this
instance means, kept alive, displayed and hidden) at runtime by a thread
whose responsibility is this sole task.
In order to run...
|
by: appdevtech |
last post by:
A little background…
We have multiple web servers in a farm and are starting to upgrade some
applications to 1.1 by re-compiling in VS2003.
One of the things out of our direct control is the framework version on the
application directory. I'm worried that in the future some directories could
be reverted back to 1.0 on all or some of the servers.
I was hoping I could force the applications I choice to always use 1.1 by
putting this in...
|
by: New user |
last post by:
How can I programmatically start a windows application when windows
loads. Can I get the code to do that, I'd rather do it with code than
with the setup & deployment wizard.
I'd also like to be able to set it up from the windows enviroment
(getting an application to load at windows startup)
| |
by: ApexData |
last post by:
Hello
I completed an application that worked great until I went to STARTUP
and shut off all of the checkboxes. My code uses
"Application.CurrentObjectName" to get the current Form name.
All my forms seem OK, but my problem exists ONLY in my initial form. If
the DataBaseWindow selection in STARTUP is OFF, then the
Application.CurrentObjectName in my initial form returns no value,
which is wrong. When DBW is ON then I get the correct...
|
by: jeff |
last post by:
Hi All.
I realize that when my Deployed winforms application starts, Windows needs
to load the .net 2 framework before control is given to my application....
Is there anyway to either ...
- preload the .net 2 framework (windows startup or whatever)
- splash a screen ... application loading ... please wait ... type of
|
by: Garry |
last post by:
Why is it that my installation od vs2005 will not accept
My.Application.OpenForms saying that it is not part of My.Application???
Dim frm As Form
For Each frm In My.Application.OpenForms
Next frm
Garry
|
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= |
last post by:
Hi
In my app I have a SplashScreen, a login form and a main form. On launching
the app, I'd like to show the SplashScreen while reading config files and
attempting a database connection. I show progress of these tasks on a label
on the SplashScreen form.
Once this is completed ok, the splash screen should close and the login form
should be displayed. A successful login closes that form and shows the main
form.
|
by: =?Utf-8?B?RVF1QWw=?= |
last post by:
Hi,
We have an application developed in VC2005 with mixed code, primarily C++
but using a C# dll for database access (DBUploader), the dll exposes a C++
interface. We are experiencing intermittent failure on startup - no errors or
warnings are generated (including in the EventVwr). Once running there are no
issues. The process is started either manually or spawned via a Windows
service. The dll is compiled with the following compiler...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |