Re: apllication wide settings storage

From: Bobby Ryzhy (bryzhy_at_hotmail.com)
Date: 07/08/04


Date: Thu, 08 Jul 2004 15:26:37 -0600

Use application variables.

example:
Global.asax.cs
protected void Application_Start(Object sender, EventArgs e)
{
        Application["variable1"] = "abc";
}

WebForm1.aspx.cs
private void Page_Load(object sender, System.EventArgs e)
{
        string var = Application["variable1"].ToString();
        Application["variable1"] = "123";
}

Bobby Ryzhy
bobby@weekendtech.net
http://www.weekendtech.net

On Thu, 8 Jul 2004 13:56:17 -0600, "Glenn Thimmes"
<glennthi@nospam_msn.com> wrote:

>I am needing to read and write application settings from within my ASP.NET
>application. My web.config is not an option since I need to be able to write
>settings as well. My database is not an option either as the database
>location itself is one of the settings.
>
>I've been trying to work with Isolated Storage, but it is obviously designed
>to be use specific. I've attempted using Impersonation to load the same
>settings for every session, but this doesn't really work. If I impersonate
>my user account it works. If I impersonate the Administrator account it
>works. But if I create a new user account on the machine and try to
>impersonate that account, I just get the following error when trying to get
>the isolated storage:
>
>Unable to create the store directory.[The system cannot find the file
>specified. ]
>
>I've even made this new account an administrator, but I still get the same
>results. Is there a better way to do what I am trying to do? Isn't there
>some simple method of saving and retrieving application wide settings in an
>ASP.NET environment? I also should mention that it is required that I use
>windows authentication for this site. When I turn that off, the IUSR account
>works just great for saving and loading settings. But unfortunately I must
>authenticate each use in order to use domain security for using Reporting
>Services.
>
>Thank you for any suggestions,
>
>-Glenn Thimmes
>



Relevant Pages

  • Application Settings
    ... I am needing to read and write application settings from within my ASP.NET ... If I impersonate the Administrator account it ... But if I create a new user account on the machine and try to ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Application Settings
    ... Since I'm using Windows authentication and I ... > download your settings. ... If I impersonate the Administrator account it ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Application Settings
    ... Another idea would be to use web.config for the read-only settings ... If I impersonate the Administrator account it ... But if I create a new user account on the machine and try to ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • apllication wide settings storage
    ... I am needing to read and write application settings from within my ASP.NET ... If I impersonate the Administrator account it ... windows authentication for this site. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Sql Reporting Serviced - > ASP.NET ACCESS DENIED!
    ... The account you are logging in to when on the server doesn't have the ... do you have <Impersonate> set to True? ... > Exception Details: System.UnauthorizedAccessException: Access to the path ...
    (microsoft.public.dotnet.framework.aspnet.security)

Loading