all groups > dotnet windows forms > february 2008 >
You're in the

dotnet windows forms

group:

Application settings



Re: Application settings rowe_newsgroups
2/13/2008 8:39:00 AM
dotnet windows forms: [quoted text, click to view]

Dang, do you search for anything?

If you didn't know, this group is archived at:

http://groups.google.com/group/microsoft.public.dotnet.languages.vb/topics?lnk=gschg&safe=on

Most of your answers could be found there or by searching google.

Thanks,

Re: Application settings kimiraikkonen
2/13/2008 9:02:25 AM
On Feb 13, 5:43 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
[quoted text, click to view]

Having .NET 2.0 with VB 2005, can i include XML settings file in my
app's root folder instead of fixed location in Windows which was
created by my.settings?

Not to be forced Like: C:\Documents and Settings\<userid>\Application
Data\
company\product\version


Also if i change location of my application my.settings are lost,
Application settings John
2/13/2008 2:47:35 PM
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

Re: Application settings Herfried K. Wagner [MVP]
2/13/2008 4:43:23 PM
"John" <John@nospam.infovis.co.uk> schrieb:
[quoted text, click to view]

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/>
Re: Application settings Herfried K. Wagner [MVP]
2/13/2008 8:11:56 PM
"kimiraikkonen" <kimiraikkonen85@gmail.com> schrieb:
[quoted text, click to view]

This is maybe possible with a custom settings provider. However, note that
the 'LocalFileSettingsProvider' provides a lot of features (support for
roaming profiles, ...) which you would have to reimplement if you roll your
own settings provider.

[quoted text, click to view]

User settings are stored there. The cryptic folder name is used to allow
multiple versions of the application to run in parallel on the same machine.
Application-scope settings are stored in the program folder. That's why it
is not possible to write them at runtime.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Re: Application settings Eric Moreau
2/13/2008 9:43:00 PM
have a look at
http://www.emoreau.com/Entries/Articles/2007/03/AppSettings-revisited.aspx

--

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)



[quoted text, click to view]
Re: Application settings John
2/15/2008 11:31:04 PM
Actually I have googled and am looking for something like this

http://www.codeproject.com/KB/cs/configeditor.aspx

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"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings"
type="System.Configuration.ApplicationSettingsGroup, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="EMS.My.MySettings"
type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"
/>
</sectionGroup>
</configSections>
<connectionStrings>
<add name="EMS.My.MySettings.EMSDataConnection"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot;C:\EMS
2008\Data\Events Manager Data.mdb&quot;" providerName="System.Data.OleDb" />
</connectionStrings>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for
My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog" />
<!-- Uncomment the below section to write to the Application Event
Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter" />
<!-- Uncomment the below section and replace APPLICATION_NAME with the
name of your application to write to the Application Event Log -->
<!--<add name="EventLog"
type="System.Diagnostics.EventLogTraceListener"
initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<applicationSettings>
<EMS.My.MySettings>
<setting name="ClientErrorLogEmailRecipient" serializeAs="String">
<value>info@mydomain.co.uk</value>
</setting>
<setting name="ErrorLogEmailFrequency" serializeAs="String">
<value>1</value>
</setting>
<setting name="Sender" serializeAs="String">
<value>EMS-Squeeze@mydomain.co.uk</value>
</setting>
<setting name="SMTPServer" serializeAs="String">
<value>smtp.myisp.co.uk</value>
</setting>
<setting name="strLocalDDB" serializeAs="String">
<value>"C:\BlahBlah\Replica of MyDB.mdb"</value>
</setting>
<setting name="strRemoteDDB" serializeAs="String">
<value>"F:\BlahBlah\MyDB.mdb"</value>
</setting>
</EMS.My.MySettings>
</applicationSettings>
</configuration>


[quoted text, click to view]

AddThis Social Bookmark Button