Application settings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Application settings

    Hi

    Is there an easy way to allow user to change application settings at run
    time short of editing the configuration file manually?

    Thanks

    Regards


  • Herfried K. Wagner [MVP]

    #2
    Re: Application settings

    "John" <John@nospam.in fovis.co.ukschr ieb:
    Is there an easy way to allow user to change application settings at run
    time short of editing the configuration file manually?
    This can be done for user settings ('My.Settings') , but it is not possible
    for settings whose scope is the whole application. In the latter case users
    typically do not have the rights to write the configuration file.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • Eric Moreau

      #3
      Re: Application settings

      have a look at


      --

      HTH

      Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
      Conseiller Principal / Senior Consultant
      Moer inc. (http://www.emoreau.com)
      Membre du réseau .NET Expertise (www.dotnet-expertise.com)



      "John" <John@nospam.in fovis.co.ukwrot e in message
      news:uSr3d9kbIH A.1188@TK2MSFTN GP04.phx.gbl...
      Hi
      >
      Is there an easy way to allow user to change application settings at run
      time short of editing the configuration file manually?
      >
      Thanks
      >
      Regards
      >

      Comment

      • John

        #4
        Re: Application settings

        Actually I have googled and am looking for something like this



        which would let the user edit application settings easily. Unfortunately
        this one does not load my app.config (given below) for some reason.

        Regards

        <?xml version="1.0" encoding="utf-8"?>
        <configuratio n>
        <configSections >
        <sectionGroup name="applicati onSettings"
        type="System.Co nfiguration.App licationSetting sGroup, System,
        Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b77a5c561934e08 9">
        <section name="EMS.My.My Settings"
        type="System.Co nfiguration.Cli entSettingsSect ion, System, Version=2.0.0.0 ,
        Culture=neutral , PublicKeyToken= b77a5c561934e08 9" requirePermissi on="false"
        />
        </sectionGroup>
        </configSections>
        <connectionStri ngs>
        <add name="EMS.My.My Settings.EMSDat aConnection"
        connectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0;Data Source=&quot;C: \EMS
        2008\Data\Event s Manager Data.mdb&quot;" providerName="S ystem.Data.OleD b" />
        </connectionStrin gs>
        <system.diagnos tics>
        <sources>
        <!-- This section defines the logging configuration for
        My.Application. Log -->
        <source name="DefaultSo urce" switchName="Def aultSwitch">
        <listeners>
        <add name="FileLog" />
        <!-- Uncomment the below section to write to the Application Event
        Log -->
        <!--<add name="EventLog"/>-->
        </listeners>
        </source>
        </sources>
        <switches>
        <add name="DefaultSw itch" value="Informat ion" />
        </switches>
        <sharedListener s>
        <add name="FileLog"
        type="Microsoft .VisualBasic.Lo gging.FileLogTr aceListener,
        Microsoft.Visua lBasic, Version=8.0.0.0 , Culture=neutral ,
        PublicKeyToken= b03f5f7f11d50a3 a, processorArchit ecture=MSIL"
        initializeData= "FileLogWri ter" />
        <!-- Uncomment the below section and replace APPLICATION_NAM E with the
        name of your application to write to the Application Event Log -->
        <!--<add name="EventLog"
        type="System.Di agnostics.Event LogTraceListene r"
        initializeData= "APPLICATION_NA ME"/-->
        </sharedListeners >
        </system.diagnost ics>
        <applicationSet tings>
        <EMS.My.MySetti ngs>
        <setting name="ClientErr orLogEmailRecip ient" serializeAs="St ring">
        <value>info@myd omain.co.uk</value>
        </setting>
        <setting name="ErrorLogE mailFrequency" serializeAs="St ring">
        <value>1</value>
        </setting>
        <setting name="Sender" serializeAs="St ring">
        <value>EMS-Squeeze@mydomai n.co.uk</value>
        </setting>
        <setting name="SMTPServe r" serializeAs="St ring">
        <value>smtp.myi sp.co.uk</value>
        </setting>
        <setting name="strLocalD DB" serializeAs="St ring">
        <value>"C:\Blah Blah\Replica of MyDB.mdb"</value>
        </setting>
        <setting name="strRemote DDB" serializeAs="St ring">
        <value>"F:\Blah Blah\MyDB.mdb"</value>
        </setting>
        </EMS.My.MySettin gs>
        </applicationSett ings>
        </configuration>


        "rowe_newsgroup s" <rowe_email@yah oo.comwrote in message
        news:fc6aa312-e4a5-41c7-942d-d330dec3f228@s8 g2000prg.google groups.com...
        On Feb 13, 9:47 am, "John" <J...@nospam.in fovis.co.ukwrot e:
        >Hi
        >>
        >Is there an easy way to allow user to change application settings at run
        >time short of editing the configuration file manually?
        >>
        >Thanks
        >>
        >Regards
        >
        Dang, do you search for anything?
        >
        If you didn't know, this group is archived at:
        >

        >
        Most of your answers could be found there or by searching google.
        >
        Thanks,
        >
        Seth Rowe [MVP]

        Comment

        Working...