473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Changing application level settings in code - How

Its easyb to change user leve settings but how do you change application
level settings in code. Apparently it seems it can't be done.
Duhhh.

Anybody manage a workaround?

Thanks for any help.
Bob
May 31 '07 #1
2 1929
robert,

What you mean with application level setting, if it is the priority have
than a look at threading.

http://msdn2.microsoft.com/en-us/lib...dpriority.aspx

Cor
"Robert Dufour" <bd*****@sgiims.comschreef in bericht
news:Oh**************@TK2MSFTNGP04.phx.gbl...
Its easyb to change user leve settings but how do you change application
level settings in code. Apparently it seems it can't be done.
Duhhh.

Anybody manage a workaround?

Thanks for any help.
Bob

May 31 '07 #2
I need to try to change those in the application settings section of the
app.config file like in the section that follows. They can be changed via
Notepad but I want to be able to change them via a user UI that is more
friendly which I could do in Vs2003. To change the setting in the
usersetttings section all you have to do is write in code
My.settings.Username = "BOB" if it is a user setting. But this does not work
with settings that are set for application level because Microsoft in its
wisdom ...ha! made these Readonly. Which means that to configure parameters
of an app you need to use an editor and you can no longer make a simple UI
to make it easy for the User to do.

If you make them User level settings then they need to be set each time
someone with a different user name logs in to the machine, which is no good
either, somme settings need to be for the app, some need to be for the
individual user.

The old method of putting the setting in vs2003 files does not permit you to
change them with the 2005 designer, but these could be changed by user in
code, I had a class to do that, but then you have 3 different ways of
storing and maintaining settings which is a lousy patch. Microsoft changed
the way the values are stored in the XML file between 2003 and 2005.They
ever heard of KISS? It means Keep It Simple Stupid! There's also wisdom in
If it ain't broke, don't fix it!

Anyways if someone has some code that allows to change setting in this
section of the app.config I would appreciate a snippet.

<applicationSettings>
<SGIIMSPostesEtPlans2007.My.MySettings>

<setting name="UserLocale" serializeAs="String">

<value>en-US</value>

</setting>

<setting name="AutomaticSenderEmailAddress" serializeAs="String">

<value>em***@company.com</value>

</setting>

<setting name="YourCompanyEmailAddress" serializeAs="String">

<value>em***@company.com</value>

</setting>

<setting name="YourCompanyName" serializeAs="String">

<value>Company name</value>

</setting>

<setting name="ConnectionString" serializeAs="String">

<value>Provider=SQLOLEDB.1;Data Source=Winxp1;Persist Security
Info=False;Integrated Security=SSPI;Initial Catalog=rmtTel</value>

</setting>

</SGIIMSPostesEtPlans2007.My.MySettings>

</applicationSettings>

</configuration>

Thanks Cor

Bob

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
robert,

What you mean with application level setting, if it is the priority have
than a look at threading.

http://msdn2.microsoft.com/en-us/lib...dpriority.aspx

Cor
"Robert Dufour" <bd*****@sgiims.comschreef in bericht
news:Oh**************@TK2MSFTNGP04.phx.gbl...
>Its easyb to change user leve settings but how do you change application
level settings in code. Apparently it seems it can't be done.
Duhhh.

Anybody manage a workaround?

Thanks for any help.
Bob


May 31 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Grumfish | last post by:
Is there a way to tell Java what localization to use so applications and the compiler doesn't default to the system's setting? I'm using a computer with Windows 2000 with a regional setting of...
1
by: serge calderara | last post by:
dear all, I have problem accessing section group in my configuration application file. I got an error saying thta I can have only one section ???? here is my application configuration looks...
4
by: Umesh | last post by:
Hi all I am trying to change the printer(like paper source ,etc) setting in C#. But i am unable to do it. I am not sure how to do it. should i have to use WIN API like Openprinter , getprinter ,...
2
by: mark | last post by:
Can't figure this one out. I appears to not be code related. After surfing my asp.net web app for a while 5 - 10 min. it fails to open any further connections to my access 2000 database. There...
4
by: tommy | last post by:
hello everbody, i write a little asp-application with forms-authentication. i copy my aspx-files with web.config to my webspace and i get the error above... i tried to set the...
3
by: Sean | last post by:
HI There, I am having trouble deploying my .aspx pages to a remote server, I have made changes to the config file and it still returns an error. I have also contacted the server administrator to...
4
by: Doug van Vianen | last post by:
Hi, I have the following coding on a web page. It causes two pictures (pic1.jpg and pic2.jpg) to show, one above the other and then when one clicks on the top picture is squeezes to the left...
2
by: ExitusLSU | last post by:
Is there a way to change the DEFAULT printer settings for an installed printer? I want it to change the printer settings for a specified printer at the whole OS/Windows level, not just for the...
4
by: Rick | last post by:
I have a VB.Net 2005 application that I am publishing to a network file server. The app reads an xml file that has some database connection information in it. This xml file is located in the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.