473,395 Members | 1,869 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,395 software developers and data experts.

Modify a web.config file

This is a stupid question but I risk it.

Just in case something is possible...

How can I modify the web.config settings from ASP.NET programming?

<system.net>
<mailSettings>
<smtp from="em***@address.ca">
<network host="link.geogio.com" password="password"
userName="username" />
</smtp>
</mailSettings>
</system.net>
Sep 17 '06 #1
2 1556
Just note that modifying the web.config will cause your application to
restart.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"3471Jack329" <Ja***@hotmail.comwrote in message
news:6I******************@wagner.videotron.net...
This is a stupid question but I risk it.

Just in case something is possible...

How can I modify the web.config settings from ASP.NET programming?

<system.net>
<mailSettings>
<smtp from="em***@address.ca">
<network host="link.geogio.com" password="password"
userName="username" />
</smtp>
</mailSettings>
</system.net>


Sep 17 '06 #2
You can't, because the file is locked. You can do it outside the web, but,
as mentioned by Eliyahu, it will restart your application, booting off all
live sessions.

In .NET 2.0, you can make additional "config" files that are linked from the
web.config and do it that way. Or, you can create your own configuration
"handler" and do whatever you wish.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"3471Jack329" <Ja***@hotmail.comwrote in message
news:6I******************@wagner.videotron.net...
This is a stupid question but I risk it.

Just in case something is possible...

How can I modify the web.config settings from ASP.NET programming?

<system.net>
<mailSettings>
<smtp from="em***@address.ca">
<network host="link.geogio.com" password="password"
userName="username" />
</smtp>
</mailSettings>
</system.net>


Sep 17 '06 #3

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

Similar topics

1
by: justin | last post by:
I have the problem that I need to programatically add new url mappings to the web.config file in an asp 2.0 app. e.g. my code is Dim urlMappings As UrlMappingCollection =...
5
by: Alberto | last post by:
I need to modify a value in the app.config file with this code: System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); string key =...
1
by: =?Utf-8?B?Q2h1Y2sgUA==?= | last post by:
I have an asp.net solution with a web deployment project. When we try to build/debug, we get the message: An editor or project is attempting to check out a file that is modified in memory,...
1
by: dhochee | last post by:
I understand that settings stored in the app.exe.config file and accessed via Properties.Settings.Default are only available within an app domain, but I'm confused about the best way to handle...
3
by: Jeff | last post by:
I have a solution with two projects. Project A is the startup project, while Project B serves as the project with the data logic. At run time, the first thing I need to do is write to Project...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi misters, i have an app.config of my App that uses WCF. I need change the configuration servicemodel, and I want update somes values.
6
by: Ramesh | last post by:
Hello, I am using the ofstream class to create a text file with keys and values like: Key1=Value10 Key2=Value15 Key3=Value20 In case I need to set a new value for Key2, say value50 - I am...
4
by: pasam | last post by:
Hi I am creating installer for asp.net i am using this code for to modify web.config file but i cant whats wrong this code ' Get configuration. Dim config As Configuration =...
5
by: ziycon | last post by:
I have two PHP files, modify.php & config.php, I have the below code in config.php and I'm wondering how I would go about searching config.php from modify.php and changing the values in config.php? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.